Search tips

Search tips

# Discussion Groups | Matlab DSP | Removing Unwanted Data Points

Technical discussion about Matlab and issues related to Digital Signal Processing.

Is this thread worth a thumbs up?

0

# Removing Unwanted Data Points - Nick13WV - Apr 30 22:03:00 2002

 I would like to remove all of the "zeros" from a data array. For Example I would like to change: A=[1 3 7 0 4 6 9 6] to A=[1 3 7 4 6 9 6] I have tried the following: for i=1:1:length(A) if A(i)==0 A(i)=[]; end end

# Re: Removing Unwanted Data Points - Rizwan Ahmed - May 1 15:05:00 2002

 use the nonzeros function ... ----- Original Message ----- From: "Nick13WV" <> To: <> Sent: Tuesday, April 30, 2002 6:03 PM Subject: [matlab] Removing Unwanted Data Points > I would like to remove all of the "zeros" from a data array. > > For Example > I would like to change: A=[1 3 7 0 4 6 9 6] > to A=[1 3 7 4 6 9 6] > > I have tried the following: > for i=1:1:length(A) > if A(i)==0 > A(i)=[]; > end > end > > > _____________________________________ > /groups.php3

# Re: Removing Unwanted Data Points - Srivathsan Krishnamachari - May 1 20:06:00 2002

 This would do the trick A = A(A ~= 0); Good luck - Srivat ----- Original Message ----- From: Nick13WV To: Sent: Tuesday, April 30, 2002 6:03 PM Subject: [matlab] Removing Unwanted Data Points I would like to remove all of the "zeros" from a data array. For Example I would like to change: A=[1 3 7 0 4 6 9 6] to A=[1 3 7 4 6 9 6] I have tried the following: for i=1:1:length(A) if A(i)==0 A(i)=[]; end end Yahoo! Groups Sponsor ADVERTISEMENT _____________________________________ /groups.php3 Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.