Sign in

Not a member? | Forgot your Password?

Search matlab

Search tips

Find us on Facebook!





Subscribe to matlab

Search tips

Free PDF Downloads

A Quadrature Signals Tutorial: Complex, But Not Complicated

Understanding the 'Phasing Method' of Single Sideband Demodulation

Complex Digital Signal Processing in Telecommunications

Introduction to Sound Processing

C++ Tutorial

Introduction of C Programming for DSP Applications

Fixed-Point Arithmetic: An Introduction

Cascaded Integrator-Comb (CIC) Filter Introduction

Discussion Groups

IIR Filter Design Software

See Also

Embedded SystemsFPGA

Discussion Groups | Matlab DSP | Removing Unwanted Data Points


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

  

Post a new Thread



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.