h = uiradiobutton()
h = uiradiobutton(parent)
h = uiradiobutton(..., propertyName, propertyValue)
| Parameter | Description |
|---|---|
| parent | parent container. |
| propertyName, propertyValue | name-value pairs. |
| Parameter | Description |
|---|---|
| h | UI component object. |
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.
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();
f = uifigure();
bg = uibuttongroup(f, 'Title', 'Options');
rb1 = uiradiobutton(bg, 'Text', 'First');
rb2 = uiradiobutton(bg, 'Text', 'Second');
rb2.Value = true;
| Version | Description |
|---|---|
| 2.0.0 | initial version |