getting coordinates from gui axes

4 vues (au cours des 30 derniers jours)
micpro
micpro le 27 Jan 2017
Commenté : micpro le 27 Jan 2017
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 commentaire
Adam
Adam le 27 Jan 2017
What aspect of get( gca, 'CurrentPoint' ) 'doesn't work'?

Connectez-vous pour commenter.

Réponses (1)

Purushottama Rao
Purushottama Rao le 27 Jan 2017
Modifié(e) : Purushottama Rao le 27 Jan 2017
You can use one of these commands to read the data on mouse click.
[x, y] = getpts(fig)
or
[x, y] = getpts(ax)
  3 commentaires
Purushottama Rao
Purushottama Rao le 27 Jan 2017
Modifié(e) : Purushottama Rao le 27 Jan 2017
You can use 'enter' after the selection of required number of data points.
micpro
micpro le 27 Jan 2017
Thanks, I get it.
Is it possible using 'enter' by commands? I mean via code?

Connectez-vous pour commenter.

Catégories

En savoir plus sur Interactive Control and Callbacks dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by