Path: news.mathworks.com!newsfeed-00.mathworks.com!kanaga.switch.ch!switch.ch!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.straub-nv.de!feeder.eternal-september.org!eternal-september.org!not-for-mail
From: dpb <none@non.net>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Get line index on matrix
Date: Thu, 05 Nov 2009 09:20:34 -0600
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <hcuqps$m6f$1@news.eternal-september.org>
References: <hcudtq$phk$1@fred.mathworks.com> <hcuetm$6t$1@fred.mathworks.com> <hcufeh$298$1@fred.mathworks.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.eternal-september.org U2FsdGVkX19roJMuzWMjnGkaurcZikcFYG7JDBfQX9x597Dx/HX5NNnse5bCg8Fean7sJ64sFMjWujnTgnFbF5225b7MpRQRWe+GIxo8dZYRdpXAembwnlPl9A2itbiiUll7fCcYXUdf/FgY8EjElw==
X-Complaints-To: abuse@eternal-september.org
NNTP-Posting-Date: Thu, 5 Nov 2009 15:25:49 +0000 (UTC)
In-Reply-To: <hcufeh$298$1@fred.mathworks.com>
X-Auth-Sender: U2FsdGVkX1/tZaEuTXu2HtHxzDusSFGbSdqEQUeoZVQ=
Cancel-Lock: sha1:tYE0COd8tQIoVbRbSTLIxaDEnWc=
User-Agent: Thunderbird 2.0.0.23 (Windows/20090812)
Xref: news.mathworks.com comp.soft-sys.matlab:582764


Joe Nunes wrote:
...
> Yes, i've tried, but IA returns an Empty matrix: 0-by-1 .. Since my
> set of points is 1312x3 and the points to find are in 17x3, i've
> tried [C,IA] = intersect(points,keypoints(2,:),'rows')
> 
> but it keeps returning empty matrix. Is this because of rounding or
> something ? i don't understand. This points from 17x3 matrix were
> taken from the original set.

Well, could well be/probably is--all it takes is the last bit of the 
mantissa to be different for the comparison to fail on equality.

You might look at comparing the individual values and outputting that 
difference/equality result to see where the actual failure is occurring. 
  If you're doing any computation or i/o or other operations between 
there are chances for rounding to occur.

But, in general, for robust coding you'll need to do some sort of 
tolerancing on the interval for selection of floating point values or 
some case will inevitably come back to bite even if you figure out a 
workaround for this specific set of values.

Somebody else noted the FAQ.

--