Get the index with the values in matlab plot
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
This is my code
view(65,0) % YZ
X = rri_0_0(1:3,:)'; %%%% data is attached
[index,tnorm]=MyRobustCrust(X);
trisurf(index,X(:,1),X(:,2),X(:,3),'facecolor','y','edgecolor','b')%plot della superficie trattata
I am using Matlab 2018b
When i put my cursor an any point in matlab plot, it gives me the coordinates of that point.
I want the index of that point in matlab plot ?
0 comentarios
Respuestas (2)
Walter Roberson
el 6 de Abr. de 2020
The basic technique is to take the data coordinates you get back, and calculate the distance to all coordinates in the graphics and find the nearest one and say that is the one you want the coordinates for.
However if you use data cursor with a line plot then you can get the index directly. This would not apply for a mesh plot such as trisurf.
https://www.mathworks.com/help/matlab/ref/matlab.graphics.shape.internal.datacursormanager.html
I have not investigated the newer interactive charts facilities; there is a link to those in the data cursor document
0 comentarios
Ver también
Categorías
Más información sobre Data Exploration en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!