AbderRahman
Computer
- Jun 18, 2008
- 2
I have the following function that checks the pixels from `x` that have the membership value `near 1` and sets those pixels in `x` to `1` and return them back. The works pretty well for me:
function c = core(x, y)
tolerance = 0.01;
[ii,jj]=find (abs
x(ii,jj)=1; % set pixels in x with y=1 to 1
idx=[ii,jj]; % indexes of pixels with y=1
c=x(abs
end
Now, to the opposite function below. I just want to check the pixels that have membership values values `not equal to one` and since in my case I don't have exactly value `1` and this used `tolerance`. I wrote what I think is the opposite of the above, but my output is an `empty matrix`. Why is that? What should I change in the function below?
function s = support(x, y)
tolerance = 0.01;
[ii,jj]= find (abs
x(ii,jj)=0; % set pixels in x with y~=1 to 0
idx=[ii,jj]; % indexes of pixels with y~=1
s=x(abs
end
Thanks.