uitogglebutton
Create toggle button component
Description
creates toggle button within
a button group and returns the tb = uitogglebuttonToggleButton object.
MATLAB® calls the uifigure function to create the parent figure of
the button group.
creates the toggle button within the specified button group. The button group must be the child
of a tb = uitogglebutton(parent)Figure object or must be parented to a child container of
the figure: Tab, Panel, ButtonGroup, or
GridLayout.
specifies tb = uitogglebutton(___,Name,Value)ToggleButton properties using one or more
Name,Value pair arguments. Use this option with any of the input argument
combinations in the previous syntaxes.
Examples
Input Arguments
Name-Value Arguments
Tips
Button groups can contain any UI component type, but can only manage the selection of radio buttons and toggle buttons.
To make your program respond when the app user selects a radio button or toggle button that is inside a button group. define a
SelectionChangedFcncallback function for theButtonGroupobject. You cannot define callbacks for the individual buttons.To determine which radio button or toggle button is selected, query the
SelectedObjectproperty of theButtonGroupobject. You can execute this query anywhere in your code.If you set the
Visibleproperty of aButtonGroupobject to'off', then any child objects it contains become invisible along with the parentButtonGroup. However, theVisibleproperty value of each child object remains unaffected.


