getting coordinates from gui axes

조회 수: 8 (최근 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 CenterFile Exchange에서 Visual Exploration에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by