matlab.system.display.Action class
Package: matlab.system.display
Superclasses:
Custom button
Syntax
matlab.system.display.Action(action)
matlab.system.display.Action(action,Name,Value)
Description
matlab.system.display.Action(action)
specifies
a button to display on the MATLAB System block. This
button executes a function by launching a System object™ method
or invoking any MATLAB® function or code.
A typical button function launches a figure. The launched figure is decoupled from the block dialog box. Changes to the block are not synced to the displayed figure.
You define matlab.system.display.Action
within the getPropertyGroupsImpl
method in your class definition file. You can define
multiple buttons using separate instances of matlab.system.display.Action
in your class definition file.
matlab.system.display.Action(action,Name,Value)
includes Name,Value
pair
arguments, which you can use to specify any properties.
Input Arguments
|
Action taken when the user presses the specified button on the MATLAB
System block dialog. The action is defined as a function handle
or as a MATLAB command. If you define the action as a function
handle, the function definition must define two inputs. These inputs
are a A |
Name-Value Pair Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Before R2021a, use commas to separate each name and value, and enclose
Name
in quotes.
Properties
You specify these properties as part of the input using Name,Value
pair
arguments. Optionally, you can define them using object.property
syntax.
ActionCalledFcn
— Action to take when the button is pressed. You cannot specify this property using a Name-Value pair argument.Label
— Text to display on the button. The default value is an empty character vector.Description
— Text for the button tooltip. The default value is an empty character vector.Placement
— Character vector indicating where on a separate row in the property group to place the button. Valid values are'first'
,'last'
, or a property name. If you specify a property name, the button is placed above that property. The default value is'last'
.Alignment
— Character vector indicating how to align the button. Valid values are'left'
and'right'
. The default value is'left'
.