uiradiobutton
Create radio button in a button group.
📝Syntax
h = uiradiobutton()
h = uiradiobutton(parent)
h = uiradiobutton(..., propertyName, propertyValue)
📥Input Arguments
Parameter Description
parent parent container.
propertyName, propertyValue name-value pairs.
📤Output Arguments
Parameter Description
h UI component object.
📄Description

rb = uiradiobutton(bg) creates a radio button inside a uibuttongroup. The first button added to a group is selected. Selection is exclusive; changes are reported by the group SelectionChangedFcn. Properties: Value (logical), Text, WordWrap, fonts.

💡Examples
Captured UI component for the help image.
f = uifigure('Visible', 'off', 'Name', 'Radio buttons', 'Position', [100 100 420 260]);
bg = uibuttongroup(f, 'Position', [95 55 230 150]);
r1 = uiradiobutton(bg, 'Text', 'Metric', 'Position', [25 95 120 22]);
r2 = uiradiobutton(bg, 'Text', 'Imperial', 'Position', [25 55 120 22]);
r1.Value = true;
drawnow();
Example illustration
uiradiobutton
f = uifigure();
bg = uibuttongroup(f, 'Title', 'Options');
rb1 = uiradiobutton(bg, 'Text', 'First');
rb2 = uiradiobutton(bg, 'Text', 'Second');
rb2.Value = true;
🔗See Also
uifigure
🕔Version History
Version Description
2.0.0 initial version
Edit this page on GitHub