Selecting a triangle from a mesh using ginput(1)
7 views (last 30 days)
Show older comments
Can anyone help on this? I'm trying to select a particular triangle, from a delaunay mesh, using the mouse pointer. the commands I am using is:
[xi,yi]=ginput(1) % acquire mouse position
TriangleNumber = tsearch(p(1,:),p(2,:),TRI,xi,yi);
The error is as follows:
Undefined function or variable 'tsearch'.
So, I tried using tsearchn. It comes up with the following error:
Error using tsearchn Too many input arguments.
Thanks
0 Comments
Accepted Answer
Geoff Hayes
on 17 May 2015
Vijay - according to tsearchn there are only three inputs to the MATLAB tsearchn function whereas you are providing 5 and so the error message makes sense. Please read the documentation to see how best to modify your values so that they can be passed into this function.
As for the error Undefined function or variable 'tsearch' it either means that you do not have this function or it is not within the MATLAB search path. In the Command Window, type
which tsearch -all
What do you see? Probably something similar to
'tsearch' not found
According to the R2012a documentation at http://www.mathworks.com/help/releases/R2012a/techdoc/ref/tsearch.html this function has been removed and the DelaunayTri/pointLocation should be used instead. You may want to look at this method and incorporate it into your software.
0 Comments
More Answers (0)
See Also
Categories
Find more on Delaunay Triangulation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!