Using Simulink |
 |
Common Block Parameters
This table lists the parameters common to all Simulink blocks, including block callback parameters, which are described in Using Callback Routines. Examples of commands that change these parameters follow this table.
Common Block Parameters
Parameter
|
Description
|
Values
|
AttributesFormat String
|
Specifies parameters to be displayed below block in a block diagram
|
string
|
BackgroundColor
|
Block icon background
|
black | {white} | red | green | blue | cyan | magenta | yellow | gray | lightBlue | orange | darkGreen
|
BlockDescription
|
Block description
|
text
|
BlockType
|
Block type
|
text
|
CloseFcn
|
Close callback
|
MATLAB expression
|
CompiledPortWidths
|
Structure of port widths
|
scalar and vector
|
CopyFcn
|
Copy callback
|
MATLAB expression
|
DeleteFcn
|
Delete callback
|
MATLAB expression
|
Description
|
User-specifiable description
|
text
|
DialogParameters
|
Names/attributes of parameters in blocks parameter dialog,
|
structure
|
DropShadow
|
Display drop shadow
|
{off} | on
|
FontAngle
|
Font angle
|
(system-dependent) {normal} | italic | oblique
|
FontName
|
Font
|
{Helvetica}
|
FontSize
|
Font size
|
{10}
|
FontWeight
|
Font weight
|
(system-dependent) light | {normal} | demi | bold
|
ForegroundColor
|
Block name, icon, outline, output signals, and signal label
|
{black} | white | red | green | blue | cyan | magenta | yellow | gray | lightBlue | orange | darkGreen
|
InitFcn
|
Initialization callback
|
MATLAB expression
|
InputPorts
|
Array of input port locations
|
[h1,v1; h2,v2; ...]
|
LinkStatus
|
Link status of block.
|
none |resolved | unresolved | implicit
|
LoadFcn
|
Load callback
|
MATLAB expression
|
ModelCloseFcn
|
Model close callback
|
MATLAB expression
|
Name
|
Block's name
|
string
|
NameChangeFcn
|
Block name change callback
|
MATLAB expression
|
NamePlacement
|
Position of block name
|
{normal} | alternate
|
ObjectParameters
|
Names/attributes of block's parameters
|
structure
|
OpenFcn
|
Open callback
|
MATLAB expression
|
Orientation
|
Where block faces
|
{right} | left | down | up
|
OutputPorts
|
Array of output port locations
|
[h1,v1; h2,v2; ...]
|
Parent
|
Name of the system that owns the block
|
string
|
ParentCloseFcn
|
Parent subsystem close callback
|
MATLAB expression
|
Position
|
Position of block in model window
|
vector [left top right bottom] not enclosed in quotes
|
PostSaveFcn
|
Post-save callback
|
MATLAB expression
|
PreSaveFcn
|
Pre-save callback
|
MATLAB expression
|
Selected
|
Block selected state
|
on | {off}
|
ShowName
|
Display block name
|
{on} | off
|
StartFcn
|
Start simulation callback
|
MATLAB expression
|
StopFcn
|
Termination of simulation callback
|
MATLAB expression
|
Tag
|
User-defined string
|
' '
|
Type
|
Simulink object type (read-only)
|
'block'
|
UndoDeleteFcn
|
Undo block delete callback
|
MATLAB expression
|
UserData
|
Any MATLAB data type (not saved in the mdl file)
|
[ ]
|
These examples illustrate how to change these parameters.
This command changes the orientation of the Gain block in the mymodel
system so it faces the opposite direction (right to left).
set_param('mymodel/Gain','Orientation','left')
This command associates an OpenFcn
callback with the Gain block in the mymodel
system.
set_param('mymodel/Gain','OpenFcn','my_open_cb')
This command sets the Position
parameter of the Gain block in the mymodel
system. The block is 75 pixels wide by 25 pixels high. The position vector is not enclosed in quotes.
set_param('mymodel/Gain','Position',[50 250 125 275])
| Model Parameters | | Block-Specific Parameters |  |