how to trace all the coordinates on the graph drawn by mouse pointer.
3 ビュー (過去 30 日間)
古いコメントを表示
please some can tell that how to find out all coordinates drawn by the mouse pointer and assign these coordinats in array.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/823240/image.png)
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 件のコメント
回答 (1 件)
DGM
2021 年 12 月 4 日
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 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!