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에서 Migrate GUIDE Apps에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!