h = uidropdown()
h = uidropdown(parent)
h = uidropdown(..., propertyName, propertyValue)
| Parameter | Description |
|---|---|
| parent | parent container. |
| propertyName, propertyValue | name-value pairs. |
| Parameter | Description |
|---|---|
| h | UI component object. |
dd = uidropdown creates a drop-down list. Items holds the displayed entries; ItemsData optionally maps each entry to a data value returned through Value. ValueIndex is the 1-based selection index. Editable 'on' lets the user type free text. Callback ValueChangedFcn (event data: Value, PreviousValue, Edited, ValueIndex, PreviousValueIndex).
f = uifigure('Visible', 'off', 'Name', 'Drop down', 'Position', [100 100 420 260]);
dd = uidropdown(f, 'Items', {'Small', 'Medium', 'Large'}, 'Position', [125 115 170 24]);
dd.Value = 'Medium';
drawnow();
f = uifigure();
dd = uidropdown(f, 'Items', {'Red', 'Green', 'Blue'}, 'ItemsData', [1 2 3]);
dd.Value = 2;
| Version | Description |
|---|---|
| 2.0.0 | initial version |