Matlab App designer 20190a
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Hussein Rida
il 16 Ago 2020
Risposto: Thiago Henrique Gomes Lobato
il 16 Ago 2020
Hello
How do i can use an if statement to know if a push button is pushed?
Example:
function button1pushed(app,event)
if button2pushed==1 (error here: To many output arguments)
errordlg('You can't push the 2 buttons','Error');
end
else
do something
end
0 Commenti
Risposta accettata
Thiago Henrique Gomes Lobato
il 16 Ago 2020
A push button cannot "stay pushed", as soon as you click it the callback is called and then the state is reset. If what you mean is the State Button, then you can get it's value as:
if app.button2pushed.Value ==1
However, to make exclusive choices the best option is actually to use a Radio Button Group or Toggle Button Group (some documentation is here).
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Migrate GUIDE Apps in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!