Path: news.mathworks.com!not-for-mail
From: "Huy " <phananhhuy@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: problem with the find function in matlab
Date: Sat, 5 Jan 2008 16:05:18 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 34
Message-ID: <flo9ru$400$1@fred.mathworks.com>
References: <bf28c7fc-c160-40da-ac3b-0e7b48b025b1@v46g2000hsv.googlegroups.com>
Reply-To: "Huy " <phananhhuy@mathworks.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 1199549118 4096 172.30.248.38 (5 Jan 2008 16:05:18 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 5 Jan 2008 16:05:18 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 113206
Xref: news.mathworks.com comp.soft-sys.matlab:444478


koolguyuf <tdgoswami@gmail.com> wrote in message <bf28c7fc-
c160-40da-ac3b-0e7b48b025b1@v46g2000hsv.googlegroups.com>...
> Hi,
> 
> I am facing some weird behavior using the find function in 
matlab
> versions 7.0 and 7.5 . I have this extremely simple code 
to execute.
> 
> a = [0:0.2:2];
> my_index = find(a == 0.6)
> 
> plz let me know whether you are getting my_index = 4 ? 
Suprisingly, I
> am not able to get it.
> 
> Plz help.
> 
> Thanks
> TD

That's right.

The first command will create a vector a 

a = [0 0.2 0.4 0.6 0.8  1.0  1.2  1.4  1.6 1.8 2.0]

The second line returns my_index = 4 because a(4) = 0.6.

Anh Huy Phan
RIKEN - BSI