| Contents | Index |
| On this page… |
|---|
This table lists the parameters common to all Simulink blocks, including block callback parameters (see Using Callback Functions). Examples of commands that change these parameters follow this table (see Examples of Setting Block Parameters).
Common Block Parameters
| Parameter | Description | Values |
|---|---|---|
AncestorBlock | Name of the library block that the block is linked to (for blocks with a disabled link). | string |
AttributesFormatString | String format specified for block annotations in the Block Parameters dialog box. | string |
BackgroundColor | Block background color. | RGB value array string | [r,g,b,a] where r, g, b, and a are the red, green, blue, and alpha values of the color normalized to the range 0.0 to 1.0, delineated with commas. The alpha value is optional and ignored. Block background color can also be 'black', 'white', 'red', 'green', 'blue', 'cyan', 'magenta', 'yellow', 'gray', 'lightBlue', 'orange', 'darkGreen'. |
BlockDescription | Block description shown in the Block Properties dialog box. | string |
BlockType | Block type (read only). | string |
ClipboardFcn | Function called when block is copied to the clipboard (Ctrl+C) or when the menu item Copy is selected. | string |
CloseFcn | Function called when close_system is run on block. | string |
Complexity of port signals after updating diagram. You must compile the model before querying this parameter. For example: vdp([],[],[],'compile'); d = get_param(gcb,'CompiledPortDataTypes'); vdp([],[],[],'term'); | structure array | |
CompiledPortDataTypes | Data types of port signals after updating diagram. You must compile the model before querying this parameter. See CompiledPortComplexSignals. | structure array |
CompiledPortDesignMin | Design minimum of port signals after updating diagram. You must compile the model before querying this parameter. For example: feval(gcs, [],[],[],'compile'); ports = get_param(gcb,'PortHandles'); min = get_param(ports.Outport, 'CompiledPortDesignMin') feval(model, [],[],[],'term'); | structure array |
CompiledPortDesignMax | Design maximum of port signals at compile time. You must compile the model before querying this parameter. For example: feval(gcs, [],[],[],'compile'); ports = get_param(gcb,'PortHandles'); max = get_param(ports.Outport, 'CompiledPortDesignMax') feval(model, [],[],[],'term'); | structure array |
CompiledPortDimensions | Dimensions of port signals after updating diagram. You must compile the model before querying this parameter. See CompiledPortComplexSignals. | structure array |
CompiledPortFrameData | Frame mode of port signals after updating diagram. You must compile the model before querying this parameter. See CompiledPortComplexSignals. | structure array |
CompiledPortWidths | Structure of port widths after updating diagram. You must compile the model before querying this parameter. See CompiledPortComplexSignals. | structure array |
CompiledSampleTime | Block sample time after updating diagram. You must compile the model before querying this parameter. See CompiledPortComplexSignals. | vector [sample time, offset time] |
ContinueFcn | Function called at the restart of a simulation (after a pause). | string |
CopyFcn | Function called when block is copied. See Block Callback Parameters in the Using Simulink documentation for details. | string |
DataTypeOverrideCompiled | For internal use. | |
DeleteFcn | Function called when block is deleted. See Block Callback Parameters in the Using Simulink documentation for details. | MATLAB expression |
DestroyFcn | Function called when block is destroyed. See Block Callback Parameters in the Using Simulink documentation for details. | MATLAB expression |
Description | Description of block. Set by the Description field in the General pane of the Block Properties dialog box. | text and tokens |
Diagnostics | For internal use. | |
DialogParameters | List of names/attributes of block-specific parameters for an unmasked block, or mask parameters for a masked block. | structure |
DropShadow | Display drop shadow. | {'off'} | 'on' |
ExtModeLoggingSupported | Enable a block to support uploading of signal data in external mode (for example, with a scope block). | {'off'} | 'on' |
ExtModeLoggingTrig | Enable a block to act as the trigger block for external mode signal uploading. | {'off'} | 'on' |
| ExtModeUploadOption | Enable a block to upload signal data in external mode when the Select all check box on the External Signal & Triggering dialog box is not selected. A value of log indicates the block uploads signals. A value of none indicates the block does not upload signals. The value monitor is currently not in use. If the Select all check box on the External Signal & Triggering dialog box is selected, it overrides this parameter setting. | {'none'} | 'log' | 'monitor' |
FontAngle | Font angle. | 'normal' | 'italic' | 'oblique' | {'auto'} |
FontName | Font name. | string |
FontSize | Font size. A value of -1 specifies that this block inherits the font size specified by the DefaultBlockFontSize model parameter. | real {'-1'} |
FontWeight | Font weight. | 'light' | 'normal' | 'demi' | 'bold' | {'auto'} |
ForegroundColor | Foreground color of block's icon. | RGB value array string | [r,g,b,a] where r, g, b, and a are the red, green, blue, and alpha values of the color normalized to the range 0.0 to 1.0, delineated with commas. The alpha value is optional and ignored. Block background color can also be 'black', 'white', 'red', 'green', 'blue', 'cyan', 'magenta', 'yellow', 'gray', 'lightBlue', 'orange', 'darkGreen'. |
Handle | Block handle. | real |
HiliteAncestors | For internal use. | |
InitFcn | Initialization function for a block. Created on the Callbacks pane of the Model Properties dialog box. See Creating Model Callback Functions in Simulink User's Guide for further information. On non-masked blocks, updating the diagram or running the simulation call this function. | MATLAB expression |
InputSignalNames | Names of input signals. | cell array |
IntrinsicDialogParameters | List of names/attributes of block-specific parameters (regardless of whether the block is masked or unmasked). Use instead of DialogParameters if you want block-specific parameters for masked or unmasked blocks. | structure |
IOSignalStrings | Block paths to objects that are connected to the Signal & Scope Manager. Simulink software saves these paths when the model is saved. | list |
IOType | Signal & Scope Manager type. For internal use. | |
LibraryVersion | For a linked block, the ModelVersion of the library at the time the link was created. | string — {'1.1'} |
LineHandles | Handles of lines connected to block. | structure |
LinkData | Array of details about changes to the blocks inside the link that differ between a parameterized link and its library, listing the block names and parameter values. Use [] to reset to deparameterized, e.g., set_param(gcb,'linkData',[]). See Parameterized Links . | cell array |
LinkStatus | Link status of block. Updates out-of-date linked blocks when queried using get_param. | 'none' | 'resolved' | 'unresolved' | 'implicit' | 'inactive' | 'restore' | 'propagate' | 'propagateHierarchy' | 'restoreHierarchy' |
LoadFcn | Function called when block is loaded. | MATLAB expression |
MinMaxOverflowLogging_Compiled | For internal use. | |
ModelCloseFcn | Function called when model is closed. The ModelCloseFcn is called prior to the block's DeleteFcn and DestroyFcn callbacks, if either are set. | MATLAB expression |
ModelParamTableInfo | For internal use. | |
MoveFcn | Function called when block is moved. | MATLAB expression |
Name | Block name. | string |
NameChangeFcn | Function called when block name is changed. | MATLAB expression |
NamePlacement | Position of block name. | {'normal'} | 'alternate' |
ObjectParameters | Names/attributes of block's parameters. | structure |
OpenFcn | Function called when this Block Parameters dialog box opens. | MATLAB expression |
Orientation | Where block faces. | {'right'} | 'left' | 'up' | 'down' |
OutputSignalNames | Names of output signals. | cell array |
Parent | Name of the system that owns the block. | string {'untitled'} |
ParentCloseFcn | Function called when parent subsystem is closed. The ParentCloseFcn of blocks at the root model level is not called when the model is closed. | MATLAB expression |
PauseFcn | Function called at the pause of a simulation. | string |
PortConnectivity | The value of this parameter is an array of structures, each of which describes one of the block's input or output ports. Each port structure has the following fields:
| structure array |
PortHandles | The value of this parameter is a structure that specifies the handles of the block's ports. The structure has the following fields:
| structure array |
PortRotationType | Type of port rotation used by this block. This is a read-only parameter. | 'default' | 'physical' |
Ports | A vector that specifies the number of each kind of port this block has. The order of the vector's elements corresponds to the following port types:
| vector |
Position | Position of block in model window. | vector of coordinates (in pixels) not enclosed in quotation marks: [left top right bottom] |
PostSaveFcn | Function called after the block is saved. | MATLAB expression |
PreCopyFcn | Function called before the block is copied. See Block Callback Parameters in the Using Simulink documentation for details. | MATLAB expression |
PreDeleteFcn | Function called before the block is deleted. See Block Callback Parameters in the Using Simulink documentation for details. | MATLAB expression |
PreSaveFcn | Function called before the block is saved. See Block Callback Parameters in the Using Simulink documentation for details. | MATLAB expression |
Priority | Specifies the block's order of execution relative to other blocks in the same model. Set by the Priority field on the General pane of the Block Properties dialog box. | string {''} |
ReferenceBlock | Name of the library block to which this block links. | string {''} |
RequirementInfo | For internal use. | |
RTWData | User specified data, used by Simulink Coder software. Intended only for use with user written S-functions. See the section S-Function RTWdata in the Simulink Coder documentation for details. | |
SampleTime | Value of the sample time parameter. See How to Specify the Sample Time in the Simulink documentation for more details. | string |
Selected | Status of whether or not block is selected. | {'on'} | 'off' |
ShowName | Display block name. | {'on'} | 'off' |
StartFcn | Function called at the start of a simulation. | MATLAB expression |
StatePerturbationForJacobian | State perturbation size to use during linearization. See Perturbation Level of Blocks Perturbed During Linearization in the Simulink Control Design documentation for details. | string |
StaticLinkStatus | Link status of block. Does not update out-of-date linked blocks when queried using get_param. See also LinkStatus. | 'none' | 'resolved' | 'unresolved' | 'implicit' | 'inactive' | 'restore' | 'propagate' | 'propagateHierarchy' | 'restoreHierarchy' |
StopFcn | Function called at the termination of a simulation. | MATLAB expression |
Tag | Text that appears in the block label that Simulink software generates. Set by the Tag field on the General pane of the Block Properties dialog box. | string {''} |
Type | Simulink object type (read only). | 'block' |
UndoDeleteFcn | Function called when block deletion is undone. | MATLAB expression |
UserData | User-specified data that can have any MATLAB data type. | {'[]'} |
UserDataPersistent | Status of whether or not UserData will be saved in the model file. | 'on' | {'off'} |
These examples illustrate how to change common block 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 quotation marks.
set_param('mymodel/Gain','Position', [50 250 125 275])
![]() | Model Parameters | Block-Specific Parameters | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |