Path: news.mathworks.com!not-for-mail
From: "Andrew " <apkelley@princeton.edu>
Newsgroups: comp.soft-sys.matlab
Subject: Logical error
Date: Thu, 22 Oct 2009 14:50:22 +0000 (UTC)
Organization: Princeton University
Lines: 16
Message-ID: <hbprfe$lvf$1@fred.mathworks.com>
Reply-To: "Andrew " <apkelley@princeton.edu>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1256223022 22511 172.30.248.35 (22 Oct 2009 14:50:22 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 22 Oct 2009 14:50:22 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 512446
Xref: news.mathworks.com comp.soft-sys.matlab:579343


I am getting a logical error with the following code which I don't understand and would appreciate any help figuring out:

>> n=0.6:0.05:2.0;
>> any(n==1.2)

ans =

     0

>> any(n==1.0)

ans =

     1

I can check all of the values in n and only the value of 1.2 returns false.  I would appreciate any help figuring this one out.  Thanks.