Enable a push button after testing conditions obtained from two other push buttons

조회 수: 1 (최근 30일)
Hi, Folks!
I have a question about using guide and I hope someone can help me.
From two push buttons, their callbacks give two values: flag1 and flag2.
So, I want to enable a third push button after comparing both flag1 and flag2. Where should I insert the if to get that?
Thanks in advanced!

채택된 답변

Walter Roberson
Walter Roberson 2016년 5월 24일
In the callbacks of both of the first two push buttons you would have something like
if handles.flag1 && handles.flag2
set(handles.button3, 'enable', 'on')
else
set(handles.button3, 'enable', 'off');
end
  댓글 수: 1
Hugo Mendonça
Hugo Mendonça 2016년 5월 24일
편집: Hugo Mendonça 2016년 5월 24일
Thank you, Walter! I just complement your answer saying that it is needed to initialize both handle structures (handle.flag1 and handle.flag2) in OpeningFcn.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by