Coordinates of manually selected point

60 ビュー (過去 30 日間)
Suhas Deshpande
Suhas Deshpande 2011 年 6 月 30 日
Is there a MATLAB command/s for getting the coordinates of manually selected point in an image (figure)? Till now I have doing this using the figure toolbar but i will need to use it in an m file.

回答 (2 件)

Jan
Jan 2011 年 6 月 30 日
What about GINPUT?
  1 件のコメント
Suhas Deshpande
Suhas Deshpande 2011 年 6 月 30 日
Thanks
This works better

サインインしてコメントする。


Gerd
Gerd 2011 年 6 月 30 日
Hi Suhas,
you can use datacursormode to solve your problem.
help datacursormode
x=linspace(0,10,1000); y=sin(x); plot(x,y) dcm = datacursormode;
In the Updatefunction of the dcm Object you can get the position on the graph that you clicked.
Gerd
  1 件のコメント
Suhas Deshpande
Suhas Deshpande 2011 年 6 月 30 日
Thanks
I used the following commands
dcm = datacursormode
(selected the point)
C = getCursorInfo(dcm)
C = C.Position

サインインしてコメントする。

製品

Community Treasure Hunt

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

Start Hunting!

Translated by