how to catch object "button"

1 Ansicht (letzte 30 Tage)
shamal
shamal am 7 Jun. 2025
Bearbeitet: Matt J am 7 Jun. 2025
hi, i try to catch this button
h = findobj('button one',app.Button) but i receive error..
How can i do it?
  2 Kommentare
Chuguang Pan
Chuguang Pan am 7 Jun. 2025
you can use gco fucntion to get the handle of current selected object.
shamal
shamal am 7 Jun. 2025
Bearbeitet: shamal am 7 Jun. 2025
it don't run
i receive "0×0 empty GraphicsPlaceholder array."
Can you do an example?

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Matt J
Matt J am 7 Jun. 2025
Bearbeitet: Matt J am 7 Jun. 2025
You have it already. app.Button is the handle to that button, unless you've renamed it to something different from the text displayed in the button.
If you have renamed the button (but not the top level UIFigure), then you could also do,
findobj(app.UIFigure,'Text','Button')

Kategorien

Mehr zu Interactive Control and Callbacks 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