Matlab App designer 20190a
1 回表示 (過去 30 日間)
古いコメントを表示
Hussein Rida
2020 年 8 月 16 日
回答済み: Thiago Henrique Gomes Lobato
2020 年 8 月 16 日
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 件のコメント
採用された回答
Thiago Henrique Gomes Lobato
2020 年 8 月 16 日
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 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Develop Apps Using App Designer についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!