Matlab App designer 20190a

1 次查看(过去 30 天)
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

采纳的回答

Thiago Henrique Gomes Lobato
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 个)

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

标签

产品


版本

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by