function mask = getmask1(phi,m,n) phi = round(phi); phi = phi-min(phi); dims = repmat([m],[1 n]); mask = {}; ii = find(phi==max(phi)); xx = ind2coord(ii(:),dims); for i=1:n mask{i} = unique(xx(:,i)); end if 0 ii = find(phi==0); xx = ind2coord(ii(:),dims); for i=1:n mask{i} = setdiff(mask{i},xx(:,i)); end end return