Path: news.mathworks.com!not-for-mail
From: "aasim Azooz" <aasimazooz@yahoo.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Data analysis
Date: Tue, 21 Jul 2009 18:43:05 +0000 (UTC)
Organization: Mosul University
Lines: 33
Message-ID: <h4527p$ppb$1@fred.mathworks.com>
References: <h44342$4iu$1@fred.mathworks.com>
Reply-To: "aasim Azooz" <aasimazooz@yahoo.com>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1248201785 26411 172.30.248.38 (21 Jul 2009 18:43:05 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 21 Jul 2009 18:43:05 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 277505
Xref: news.mathworks.com comp.soft-sys.matlab:557256


"Jesper Lauridsen" <jesperholst_5@hotmail.com> wrote in message <h44342$4iu$1@fred.mathworks.com>...
> I have the following data in a vector called DATA1:
> 
> 0.015
> 0.01
> 0.01
> 0.01
> 0.01
> 0.005
> 0.005
> 0.005
> 0.005
> 0.005
> 0.005
> 0.005
> 0.005
> 0.005
> 
> What I want is to replace all values that are less or equal to 0.005 with zero in the vector. I was thinking to use some kind of if statement.
> 
> if DATA_1<=0.005
> ...........
> else
> ...........
> end
Try

k=find(DATA1<=0)
DATA1(k)=0

good luck 

Aasim Azooz