getting coordinates from gui axes

5 ビュー (過去 30 日間)
micpro
micpro 2017 年 1 月 27 日
コメント済み: micpro 2017 年 1 月 27 日
Hi,
I work with a GUI includes axes ( matlab2016a ),
I already activated the datacursor in gui side (from toolbar),
I can see coordinates when I click to graph,
But I want to get coordinates of mouse click, I mean reading the values, x and y,
I try with cp = get(gca,'CurrentPoint');
Does not work.
Can anyone help?
Regards.
  1 件のコメント
Adam
Adam 2017 年 1 月 27 日
What aspect of get( gca, 'CurrentPoint' ) 'doesn't work'?

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

回答 (1 件)

Purushottama Rao
Purushottama Rao 2017 年 1 月 27 日
編集済み: Purushottama Rao 2017 年 1 月 27 日
You can use one of these commands to read the data on mouse click.
[x, y] = getpts(fig)
or
[x, y] = getpts(ax)
  3 件のコメント
Purushottama Rao
Purushottama Rao 2017 年 1 月 27 日
編集済み: Purushottama Rao 2017 年 1 月 27 日
You can use 'enter' after the selection of required number of data points.
micpro
micpro 2017 年 1 月 27 日
Thanks, I get it.
Is it possible using 'enter' by commands? I mean via code?

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

カテゴリ

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