From: Priom Rahman on 30 Jul 2010 18:47 Could someone tell me how to search for all the zero's in a martix and then replace it wirh NaN ? say: x = [1 1 1 0; 1 1 0 0; 0 0 0 0; 1 1 0 1; 0 0 1 1] x = 1 1 1 0 1 1 0 0 0 0 0 0 1 1 0 1 0 0 1 1 I can find the 0 using find(x == 0) ans = 3 5 8 10 12 13 14 16 17 18 But how do I replace these values ? I'm sorry if similar questions have been answered, but I could only find examples of replacing NaNs with numbers or integers.
From: ImageAnalyst on 30 Jul 2010 18:55 x(x==0)=nan
From: Walter Roberson on 30 Jul 2010 18:55 ImageAnalyst wrote: > x(x==0)=nan x(~x)=nan; % :p
From: Priom Rahman on 30 Jul 2010 19:02 Brilliant thanks !!!!!!
|
Pages: 1 Prev: redundant Haar wavelet transform Next: scrollbar/slider for the axes |