Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

Radio Button and Panel GUIDE

Asked by Melvin

Melvin (view profile)

on 24 Feb 2012
Latest activity Edited by chaocanha

chaocanha (view profile)

on 23 Oct 2013

What code should i write under a callback of the radio button when you want to click a radio button, the visibility of the panel is being controlled. Radio button clicked, Panel appears. Radio Button unclick, panel hides...what do you think? Thank you everyone

1 Comment

Melvin

Melvin (view profile)

on 24 Feb 2012

the panel---i mean a panel you created on a gui...so only two objects are present on the gui. The radio button and a panel...thank you

Melvin

Melvin (view profile)

Tags

Products

No products are associated with this question.

1 Answer

Answer by G A

G A (view profile)

on 24 Feb 2012

if (get(hObject,'Value') == get(hObject,'Max'))

set (handles.my_uipanel,'Visible','on');

else

set (handles.my_uipanel,'Visible','off');

end

7 Comments

G A

G A (view profile)

on 24 Feb 2012

I have edited the code above

Melvin

Melvin (view profile)

on 25 Feb 2012

what changes have you made?

G A

G A (view profile)

on 27 Feb 2012

Instead of checking for Value 1 or 0 (true or false), for radio button you have to check for Value 'Max' or 'Min'

G A

G A (view profile)

Contact us