how to catch object "button"

hi, i try to catch this button
h = findobj('button one',app.Button) but i receive error..
How can i do it?

2 个评论

you can use gco fucntion to get the handle of current selected object.
shamal
shamal 2025-6-7
编辑:shamal 2025-6-7
it don't run
i receive "0×0 empty GraphicsPlaceholder array."
Can you do an example?

请先登录,再进行评论。

回答(1 个)

Matt J
Matt J 2025-6-7
编辑:Matt J 2025-6-7
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')

类别

提问:

2025-6-7

编辑:

2025-6-7

Community Treasure Hunt

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

Start Hunting!

Translated by