Selecting a triangle from a mesh using ginput(1)

5 visualizaciones (últimos 30 días)
Vijay Nahar
Vijay Nahar el 17 de Mayo de 2015
Respondida: Geoff Hayes el 17 de Mayo de 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

Respuesta aceptada

Geoff Hayes
Geoff Hayes el 17 de Mayo de 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.

Más respuestas (0)

Categorías

Más información sobre Delaunay Triangulation en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by