Is there a way to create two toggle buttons in a Matlab GUI such that one toggles the other? In other words, if button A is on, how can I create a button B that when turned on makes A go off?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I have version R2009a, so I don’t know if this works for you or not:
I defined two push buttons with
guide(with default names). When the first is clicked it is disabled (Enable: Off), its Value set to 1 and its String to On; the second push button is set to the other state. A similar behavior is given to the other button.If you want to toggle the behavior of button2 according to the state of button1 then do the following:
Is this what you need?