Selecting a triangle from a mesh using ginput(1)
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Geoff Hayes
2015-5-17
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Delaunay Triangulation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!