Matlab App designer 20190a
1 view (last 30 days)
Hussein Rida on 16 Aug 2020
How do i can use an if statement to know if a push button is pushed?
if button2pushed==1 (error here: To many output arguments)
errordlg('You can't push the 2 buttons','Error');
Thiago Henrique Gomes Lobato on 16 Aug 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).