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(y)-1 <=...