Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: nearestNeighbor
Replies: 4   Last Post: Jul 20, 2011 4:46 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Michel Slivitzky

Posts: 69
Registered: 12/7/04
Re: nearestNeighbor
Posted: Jul 20, 2011 4:46 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Thanks very much Steve,
Your last answer was exactly what I was looking for.

Michel

"Steven_Lord" <slord@mathworks.com> wrote in message <j078mk$ju0$1@newscl01ah.mathworks.com>...
>
>
> "Michel " <slivitz@cite.net> wrote in message
> news:j072mf$1l7$1@newscl01ah.mathworks.com...

> > Thanks for the information
> > Yes , I am using DelaunayTri
> > If I look at the 3 index values returned from DT(SI,:) by pointLocation
> > - one of them is exactly the same as the index returned from
> > nearestNeighbor
> > - but how do I know which one is the nearest ?

>
> If pointLocation returns NaN, the point is outside the convex hull of your
> data. That answers your question:
>

> >> > Is there a way to figure if the query point is "in" the domain ?
>
>
> If you're looking for the nearest vertex for those points that are inside
> the convex hull, remove those points you located using pointLocation then
> use nearestNeighbor on the remaining points. Alternately just take the
> coordinates of the vertices that make up the triangle that pointLocation
> returned and compute the distance (using HYPOT, NORM, etc.) yourself then
> choose the MIN.
>
> If this is not what you're looking for, please explain in more depth exactly
> what you're trying to do.
>
> --
> Steve Lord
> slord@mathworks.com
> To contact Technical Support use the Contact Us link on
> http://www.mathworks.com




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.