how to trace all the coordinates on the graph drawn by mouse pointer.
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
please some can tell that how to find out all coordinates drawn by the mouse pointer and assign these coordinats in array.

for example let suppose this blue one curve is drawn by my mouse pointer, then how to find all the coordinate of this curve and assign into a array. ofcourse there should be a step size between the coordinates.
Thank You.
0 comentarios
Respuestas (1)
DGM
el 4 de Dic. de 2021
It depends what you mean by "drawn with the mouse". What are you using to draw with the mouse?
If you have IPT, you can use imfreehand() or drawfreehand()
% just make some dummy plot so that an axes exists
x = 1:10;
plot(x); hold on
% draw a curve and get the points
hf = drawfreehand(gca);
pointlist = hf.Position
delete(hf) % delete if unneeded
% show that point list corresponds to the drawn object
plot(pointlist(:,1),pointlist(:,2),'x:')
The spacing is velocity-dependent. You can reduce the relative spacing scale afterwards by simply subsampling the point list.
0 comentarios
Ver también
Categorías
Más información sobre 2-D and 3-D Plots 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!