I have a matrix [640 640] with few non zero values and many zeros. I want to put all the non zero values in a new matrix. Something like:
for i=1:640
for j=1:640if A(i,j)~=0B(i,j)=A(i,j) end
end
end
But this doesn't work.. Any suggestions?
Best Answer