Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!y7g2000yqa.googlegroups.com!not-for-mail
From: "david.correa@gmail.com" <david.correa@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Data analysis
Date: Tue, 21 Jul 2009 10:11:01 -0700 (PDT)
Organization: http://groups.google.com
Lines: 55
Message-ID: <59e5dd4a-3afa-4362-b0c0-61d65368f8e5@y7g2000yqa.googlegroups.com>
References: <h44342$4iu$1@fred.mathworks.com> <h4447l$i4a$1@fred.mathworks.com>
NNTP-Posting-Host: 190.81.184.125
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1248196262 21480 127.0.0.1 (21 Jul 2009 17:11:02 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 21 Jul 2009 17:11:02 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: y7g2000yqa.googlegroups.com; posting-host=190.81.184.125; 
	posting-account=SDToZwoAAAAnN_L6GH6ilE6wsubVt-vp
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; 
	InfoPath.1),gzip(gfe),gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:557213


On Jul 21, 5:11 am, "Geant Bepi"
<timothyschru_useonlywhatsbeforeundersc...@yahoo.co.uk> wrote:
> "Jesper Lauridsen" <jesperhols...@hotmail.com> wrote in message <h44342$4i...@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
>
> there can be several methods to do this depending on how you are going to use the filtered data.
> try using logical indexing;
> e.g;
> data = DATA_1(:,1)
> zee = (data <= 0.005)
>
> then you can set 'zee' to zero when performing a calculation..- Hide quoted text -
>
> - Show quoted text -

Hi,

Try this,

AA=[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]


ind=find(AA<=0.005)

AA(ind)=0

David C.