FUNCTION REFERENCE

uiswitch

Create two-state switch component.

Create two-state switch component.

Syntax

sw = uiswitch

Syntax

sw = uiswitch(parent, Name, Value)

Syntax

sw = uiswitch(parent, style, Name, Value)

Switches between two Items (or ItemsData) with style 'slider' (default), 'rocker', or 'toggle', Orientation, Value, and ValueChangedFcn.

Example

fig = uifigure; sw = uiswitch(fig, 'Items', {'Off', 'On'}, 'Value', 'On'); sw.Value; delete(fig)

Differences from MATLAB: FontColor and custom font weight/angle styling are not supported yet.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.