Hello, I have an image with a circular shape at center and I need to detrend each vector of the matrix avoiding the outside value, which is equal to 0. If I would like to have just the circular shape (so not a squared or rectangular matrix) how can I do? I created a loop to have a new matrix where 0 value is equal 0 and 1 all the other values (cause I need the index to reduce each vector). Now I was thinking to do that with a cell array an put inside the portion of each vector characterized by 1 value, but with the lines I wrote it gives me just the first vector. Any suggestion or new idea to solve the problem?
for jj = [1:n] %n is the number of the raw
kk=1:n/2; % n/2 number of columns
d1(jj,kk)=new1(jj,:) ~= 5958 ; % new1 is my matrix
data.b3=cell (1,n); data.b3= find(d1(jj,kk) == 1 );end
Best Answer