Path: news.mathworks.com!not-for-mail
From: "Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid>
Newsgroups: comp.soft-sys.matlab
Subject: Re: problem with the find function in matlab
Date: Sun, 6 Jan 2008 03:46:36 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 15
Message-ID: <flpius$qg3$1@fred.mathworks.com>
References: <bf28c7fc-c160-40da-ac3b-0e7b48b025b1@v46g2000hsv.googlegroups.com> <flpgo6$ouf$1@fred.mathworks.com>
Reply-To: "Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1199591196 27139 172.30.248.37 (6 Jan 2008 03:46:36 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 6 Jan 2008 03:46:36 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: news.mathworks.com comp.soft-sys.matlab:444510


"Jerecho " <jeric3182@mathworks.com> wrote in message <flpgo6$ouf
$1@fred.mathworks.com>...
> Im also experiencing the same problem. But when I 
> entered 'a' manually (i.e. a = [0 0.1 0.2 0.4 0.6 ... 2])
> I get the correct answer.
-------
That should tell you what the trouble is, Jerecho.  It's not the fault of 'find'.  It's 
because 0:.2:2 generates a slightly different vector of values than [0,.2,.4,.6, 
etc].  And that in turn is because it does not have an exact value of .2 to work 
with.  It cannot achieve .2 precisely and any calculations with it are bound to go 
slightly wrong at some stage.

Roger Stafford