Filter löschen
Filter löschen

ButtonDownFcn / need some explanation

1 Ansicht (letzte 30 Tage)
Max Müller
Max Müller am 18 Jul. 2014
Beantwortet: Image Analyst am 18 Jul. 2014
Hey Guys,
I ve read a lot of stuff for the last 2 hours but I still dont know how to use the Function. The Problem: My GUI reads Data and plots it in a new figure as subplot.(Figurename = Plot) Now I want to create a Push button, which uses somehow the ButtonDownFcn to give me the coordinates of where I clicked...... Qestions: How does the ButtonDownFcn work ? Is there a another alternative ? Can i Activate the datacursormode for my Plot-figure ?
Thanks
  1 Kommentar
Joakim Magnusson
Joakim Magnusson am 18 Jul. 2014
Bearbeitet: Joakim Magnusson am 18 Jul. 2014
Do you want the coordinates of where you clicked at the pushbutton? Or where you click inside the plot? It's hard to understand exactly what you want to do.
If you just want to know how ButtonDownFcn works it's explained quite well in the documentation.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Image Analyst
Image Analyst am 18 Jul. 2014
Why not have a push button where in the callback function, you call
uiwait(helpdlg('Click in the plot'));
[x, y] = ginput(1);
Your user clicks in the plot and ginput() returns the x and y of where they clicked.

Weitere Antworten (0)

Kategorien

Mehr zu Visual Exploration finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by