Selecting a triangle from a mesh using ginput(1)
    6 Ansichten (letzte 30 Tage)
  
       Ältere Kommentare anzeigen
    
    Vijay Nahar
      
 am 17 Mai 2015
  
    
    
    
    
    Beantwortet: Geoff Hayes
      
      
 am 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 Kommentare
Akzeptierte Antwort
  Geoff Hayes
      
      
 am 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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
				Mehr zu Spatial Search finden Sie in Help Center und File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

