Question

When I want to know which radio buttons are selected in a panel in a MATLAB GUI, I use this line:

ChosenOption = get(handles.OptionPanel, 'SelectedObject');

where OptionPanel is the Tag of the panel where the radio buttons are located.

However, if I want to use checkboxes instead of radio buttons, is there any way to do the same?

Thank you.

Was it helpful?

Solution

You would typically get the Value property of each checkbox to determine whether it was checked or not.

Note that typically with checkboxes any, all, or none of the checkboxes may be selected (in contrast to radio buttons, where typically only a single radio button would be selected at any one time), so you would want to get the Value property of each checkbox separately. There's no equivalent of a uibuttongroup that you would use with radio buttons (although you can of course graphically group the checkboxes in a uipanel).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top