フィルターのクリア

How to storage the coordinates of a pixel in Gui?

1 回表示 (過去 30 日間)
anahita
anahita 2013 年 7 月 8 日
In the Gui that I've created, the user should be able to click somewhere on the displaying image in an axes, and storage the coordinates of that pixel too use them later, but I don't know how should I 1. find the coordinates and 2. storage them for using them in another function later...

採用された回答

Evan
Evan 2013 年 7 月 8 日
編集済み: Evan 2013 年 7 月 8 日
help ginput
That function will get the coordinates of the pixel the user clicks. You could have the user press a pushbutton to enable the pixel selection, then put your ginput call in the pushbutton callback.
Then, you can store these values by saving them to the handles structure:
[x,y] = ginput(N) %where N is the number of points desired
handles.X = x;
handles.Y = y;
guidata(handles.my_pushbutton,handles)
  2 件のコメント
anahita
anahita 2013 年 7 月 8 日
Thank you so much for the answer
Evan
Evan 2013 年 7 月 8 日
編集済み: Evan 2013 年 7 月 8 日
No problem! :)

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by