multiple actions following @(src,event) in uicontrol

6 Ansichten (letzte 30 Tage)
feynman feynman
feynman feynman am 10 Mär. 2024
Kommentiert: Voss am 10 Mär. 2024
How to add another action or function to the following
Button=uicontrol('Style','pushbutton', 'String','pause','Position',[1800 60 100 100], 'Callback',@(src,event)continue);
so that it becomes sth like
Button=uicontrol('Style','pushbutton', 'String','pause','Position',[1800 60 100 100], 'Callback',@(src,event){continue,close});

Akzeptierte Antwort

Voss
Voss am 10 Mär. 2024
Define a function that has whatever code in it you want.
Then make that function the button's callback:
Button=uicontrol('Style','pushbutton', 'String','pause','Position',[1800 60 100 100], 'Callback',@(src,event)your_function);
  4 Kommentare
feynman feynman
feynman feynman am 10 Mär. 2024
perfect, thanks
Voss
Voss am 10 Mär. 2024
You're welcome!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Migrate GUIDE Apps finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by