Selecting a triangle from a mesh using ginput(1)
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Vijay Nahar
le 17 Mai 2015
Réponse apportée : Geoff Hayes
le 17 Mai 2015
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 commentaires
Réponse acceptée
Geoff Hayes
le 17 Mai 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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Delaunay Triangulation dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!