Path: news.mathworks.com!not-for-mail
From: "Ashwini Deshpande" <vd.ashwini@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: ismember - getting wrong result
Date: Thu, 12 Mar 2009 13:04:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 20
Message-ID: <gpb180$5uv$1@fred.mathworks.com>
Reply-To: "Ashwini Deshpande" <vd.ashwini@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 1236863041 6111 172.30.248.38 (12 Mar 2009 13:04:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 12 Mar 2009 13:04:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1101624
Xref: news.mathworks.com comp.soft-sys.matlab:524306


Hi,

I have a matrix as follows,

a = 0:0.1:1;

when i tried to find whether 0.300 is present in the matrix 'a', using following procedure, 
>> [tf, loc]=ismember(0.3,a)

i got the following result:
tf =
     0
loc =
     0
But it suppose to give me, tf = 1 and loc =4.

Can anyone tell me, what is the problem and how to overcome it..
Thanks !
Ashwini