Azzera filtri
Azzera filtri

how to trace all the coordinates on the graph drawn by mouse pointer.

4 visualizzazioni (ultimi 30 giorni)
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.

Risposte (1)

DGM
DGM il 4 Dic 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.

Categorie

Scopri di più su 2-D and 3-D Plots in Help Center e File Exchange

Prodotti


Release

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by