Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: ismember - getting wrong result
Date: Mon, 16 Mar 2009 12:06:15 +0000 (UTC)
Organization: Queen's University
Lines: 19
Message-ID: <gplfbn$3sp$1@fred.mathworks.com>
References: <gpb180$5uv$1@fred.mathworks.com> <gpb1n2$851$1@fred.mathworks.com>
Reply-To: <HIDDEN>
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 1237205175 3993 172.30.248.37 (16 Mar 2009 12:06:15 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 16 Mar 2009 12:06:15 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 943450
Xref: news.mathworks.com comp.soft-sys.matlab:525182


"us " <us@neurol.unizh.ch> wrote in message <gpb1n2$851$1@fred.mathworks.com>...
.....
> % also, peruse     
> 
> http://matlabwiki.mathworks.com/MATLAB_FAQ#Why_is_0.3-0.2-0.1_not_equal_to_zero_.28or_similar.29.3F
> 
> us

I found that link interesting.  I guess the colon operator is more complicated than I had realised.  Despite being aware of floating point considerations, I had found the behaviour of ismember (at least in 2008a) a bit odd at times, e.g.

ismember(0:.1:.5, 0:.1:.5)
ans =
     1     1     1     1     1     1
>> ismember(0:.1:.5, 0:.1:.6)
ans =
     1     1     1     1     0     1
>> ismember(0:.1:.5, 0:.1:.7)
ans =
     1     1     1     0     0     0