Coordinates of manually selected point

조회 수: 34 (최근 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?

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

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 MATLAB Support Package for USB Webcams에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by