uiselectiongroup
R2026bCreate selection group for radio buttons and toggle buttons
Since R2026b. Recommended over uibuttongroup.
Description
creates an empty single
selection group and returns a sg = uiselectiongroupSingleSelectionGroup object.
sets sg = uiselectiongroup(___,Name=Value)SingleSelectionGroup properties using one or more name-value
arguments. Use this option with any of the input argument combinations in the previous
syntaxes. For example, uiselectiongroup(members,SelectedObject=button1)
creates a single selection group with button1 selected.
Examples
Input Arguments
Name-Value Arguments
Output Arguments
Tips
Buttons managed by a selection group can be in any container within the same figure.
To add or remove buttons after creating the group, use the
addMemberandremoveMemberfunctions.To make your program respond when an app user selects a radio button or toggle button that is inside a selection group, define a
SelectionChangedFcncallback for the selection group. You cannot define callbacks for the individual buttons.To determine which button is currently selected, query the
SelectedObjectproperty of the selection group.
Version History
Introduced in R2026b



