h = uispinner()
h = uispinner(parent)
h = uispinner(..., propertyName, propertyValue)
| Parameter | Description |
|---|---|
| parent | parent container. |
| propertyName, propertyValue | name-value pairs. |
| Parameter | Description |
|---|---|
| h | UI component object. |
spn = uispinner creates a numeric spinner. Properties: Value, Step, Limits, LowerLimitInclusive/UpperLimitInclusive, RoundFractionalValues, ValueDisplayFormat, AllowEmpty, Editable, ValueChangedFcn, ValueChangingFcn.
f = uifigure('Visible', 'off', 'Name', 'Spinners', 'Position', [100 100 460 280]);
uilabel(f, 'Text', 'Quantity', 'FontWeight', 'bold', 'Position', [80 185 100 24]);
qty = uispinner(f, 'Value', 8, 'Step', 1, 'Limits', [0 20], 'Position', [210 180 130 30]);
uilabel(f, 'Text', 'Ratio', 'FontWeight', 'bold', 'Position', [80 130 100 24]);
ratio = uispinner(f, 'Value', 0.75, 'Step', 0.05, 'Limits', [0 1], 'Position', [210 125 130 30]);
drawnow();
f = uifigure();
spn = uispinner(f, 'Value', 5, 'Step', 0.5, 'Limits', [0 10]);
| Version | Description |
|---|---|
| 2.0.0 | initial version |