MATLAB Answers

0

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

Asked by Hugo Mendonça on 24 May 2016
Latest activity Edited by Hugo Mendonça on 24 May 2016
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!

  0 Comments

Sign in to comment.

1 Answer

Answer by Walter Roberson
on 24 May 2016
 Accepted Answer

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 Comment

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.

Sign in to comment.