Clear Filters
Clear Filters

Coordinates of manually selected point

28 views (last 30 days)
Suhas Deshpande
Suhas Deshpande on 30 Jun 2011
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.

Answers (2)

Jan on 30 Jun 2011
What about GINPUT?

Gerd on 30 Jun 2011
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.
  1 Comment
Suhas Deshpande
Suhas Deshpande on 30 Jun 2011
I used the following commands
dcm = datacursormode
(selected the point)
C = getCursorInfo(dcm)
C = C.Position

Sign in to comment.


Community Treasure Hunt

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

Start Hunting!