I wrote this function in matlab
that sets the value of the pixels x
that have a degree of membership y
= 1
to 1
as follows:
function c = core(x, y)
tolerance = 0.01;
pixels = [];
index = 1;
for i=1:length(y)
for j=1:length(y)
if abs(y(i,j)-1) <= tolerance
x(i,j) = 1;
pixels(index) = x(i,j);
end
end
end
c = pixels;
end
Since I'm calling this function from a script, how can I return back those pixels that were set to 1
? Or, will the correct way here to return the original image with the pixels that met the criterion set to 1
.
Bur, before I continue, I didn't see that the pixels in the image that met the criterion were set to 1
. Isn't my of setting the pixel to 1
correct?
The bottom line is that I'm assuming that core
represents those pixels that had the degree of membership equal to 1
. And, in the algorithm I'm trying to implement, I have the following line:
C1 = core(F)
Where F
represents the image.
Based on that, what is the correct way to write this in matlab
. Well, yes, in matlab
this line can simply be written as:
C.('C1') = core(x,y);
But, the question is, based on the information above, what will be returned to my calling script and how?
And, yes, as an output, I'm always getting 1
in ans
. Why is that?
Thanks.