
- •Block Reference
- •Commonly Used
- •Continuous
- •Discontinuities
- •Discrete
- •Logic and Bit Operations
- •Lookup Tables
- •Math Operations
- •Model Verification
- •Model-Wide Utilities
- •Ports & Subsystems
- •Signal Attributes
- •Signal Routing
- •Sinks
- •Sources
- •User-Defined Functions
- •Additional Math & Discrete
- •Additional Discrete
- •Additional Math: Increment — Decrement
- •Run on Target Hardware
- •Target for Use with Arduino Hardware
- •Target for Use with BeagleBoard Hardware
- •Target for Use with LEGO MINDSTORMS NXT Hardware
- •Blocks — Alphabetical List
- •Command-Line Information
- •Command-Line Information
- •Command-Line Information
- •Command-Line Information
- •Command-Line Information
- •Command-Line Information
- •Command-Line Information
- •Command-Line Information
- •Command-Line Information
- •Command-Line Information
- •Command-Line Information
- •Command-Line Information
- •Command-Line Information
- •Command-Line Information
- •Command-Line Information
- •Command-Line Information
- •Settings Pane
- •Measurements Pane
- •Signal Statistics Measurements
- •Settings Pane
- •Transitions Pane
- •Overshoots/Undershoots
- •Cycles
- •Settings Pane
- •Peaks Pane
- •Command-Line Information
- •Command-Line Information
- •Command-Line Information
- •Command-Line Information
- •Command-Line Information
- •Command-Line Information
- •Command-Line Information
- •Command-Line Information
- •Command-Line Information
- •Function Reference
- •Model Construction
- •Simulation
- •Linearization and Trimming
- •Data Type
- •Examples
- •Main Toolbar
- •Command-Line Alternative
- •Command-Line Alternative
- •Command-Line Alternative
- •Command-Line Alternative
- •Command-Line Alternative
- •Command-Line Alternative
- •Mask Icon Drawing Commands
- •Simulink Classes
- •Model Parameters
- •About Model Parameters
- •Examples of Setting Model Parameters
- •Common Block Parameters
- •About Common Block Parameters
- •Examples of Setting Block Parameters
- •Block-Specific Parameters
- •Mask Parameters
- •About Mask Parameters
- •Notes on Mask Parameter Storage
- •Simulink Identifier
- •Simulink Identifier
- •Model Advisor Checks
- •Simulink Checks
- •Simulink Check Overview
- •See Also
- •Identify unconnected lines, input ports, and output ports
- •Description
- •Results and Recommended Actions
- •Capabilities and Limitations
- •Tips
- •See Also
- •Check root model Inport block specifications
- •Description
- •Results and Recommended Actions
- •See Also
- •Check optimization settings
- •Description
- •Results and Recommended Actions
- •Tips
- •See Also
- •Description
- •Results and Recommended Actions
- •See Also
- •Check for implicit signal resolution
- •Description
- •Results and Recommended Actions
- •See Also
- •Check for optimal bus virtuality
- •Description
- •Results and Recommended Actions
- •Capabilities and Limitations
- •See Also
- •Description
- •Results and Recommended Actions
- •Capabilities and Limitations
- •See Also
- •Identify disabled library links
- •Description
- •Results and Recommended Actions
- •Capabilities and Limitations
- •Tips
- •See Also
- •Identify parameterized library links
- •Description
- •Results and Recommended Actions
- •Capabilities and Limitations
- •Tips
- •See Also
- •Identify unresolved library links
- •Description
- •Results and Recommended Actions
- •Capabilities and Limitations
- •See Also
- •Results and Recommended Actions
- •Capabilities and Limitations
- •See Also
- •Results and Recommended Actions
- •Capabilities and Limitations
- •See Also
- •Check usage of function-call connections
- •Description
- •Results and Recommended Actions
- •See Also
- •Check signal logging save format
- •Description
- •Results and Recommended Actions
- •See Also
- •Description
- •Results and Recommended Actions
- •See Also
- •Description
- •Results and Recommended Actions
- •Tips
- •See Also
- •Check data store block sample times for modeling errors
- •Description
- •Results and Recommended Actions
- •See Also
- •Check for potential ordering issues involving data store access
- •Description
- •Results and Recommended Actions
- •Tips
- •See Also
- •Check for partial structure parameter usage with bus signals
- •Description
- •Results and Recommended Actions
- •Tips
- •See Also
- •Check for calls to slDataTypeAndScale
- •Description
- •Results and Recommended Actions
- •Tips
- •See Also
- •Check for proper bus usage
- •Description
- •Results and Recommended Actions
- •Action Results
- •Tips
- •See Also
- •Description
- •Results and Recommended Actions
- •See Also
- •Description
- •Results and Recommended Actions
- •See Also
- •Check for proper Merge block usage
- •Description
- •Input Parameters
- •Results and Recommended Actions
- •See Also
- •Description
- •Results and Recommended Actions
- •Action Results
- •See Also
- •Check for non-continuous signals driving derivative ports
- •Description
- •Results and Recommended Actions
- •See Also
- •Runtime diagnostics for S-functions
- •Description
- •Results and Recommended Actions
- •See Also
- •Check file for foreign characters
- •Description
- •Results and Recommended Actions
- •Tips
- •See Also
- •Check model for known block upgrade issues
- •Description
- •Results and Recommended Actions
- •Action Results
- •See Also
- •Description
- •Results and Recommended Actions
- •Action Results
- •See Also
- •Check that the model is saved in SLX format
- •Description
- •Results and Recommended Actions
- •Tips
- •See Also
- •Check Model History properties
- •Description
- •Results and Recommended Actions
- •See Also
- •Analyze model hierarchy for upgrade issues
- •Description
- •Results and Recommended Actions
- •Tips
- •See Also
- •Description
- •Results and Recommended Actions
- •See Also
- •Simulink Performance Advisor Checks
- •Simulink Performance Advisor Check Overview
- •See Also
- •Baseline
- •See Also
- •Check Preupdate Items
- •See Also
- •Checks that need Update Diagram
- •See Also
- •Checks that require simulation to run
- •See Also
- •Check Accelerator Settings
- •See Also
- •Create Baseline
- •See Also
- •Identify resource intensive diagnostic settings
- •See Also
- •Check optimization settings
- •See Also
- •Identify inefficient lookup table blocks
- •See Also
- •Identify Interpreted MATLAB Function blocks
- •See Also
- •Check MATLAB Function block debug settings
- •See Also
- •Check Stateflow block debug settings
- •See Also
- •Identify simulation target settings
- •See Also
- •Check model reference rebuild setting
- •See Also
- •Check Model Reference parallel build
- •See Also
- •Check solver type selection
- •See Also
- •Select normal or accelerator simulation mode
- •See Also
- •Simulink Limits
- •Maximum Size Limits of Simulink Models
- •Index
- •Filter Structures and Filter Coefficients
- •Valid Initial States
- •Number of Delay Elements (Filter States)
- •Frame-Based Processing
- •Sample-Based Processing
- •Valid Initial States
- •Frame-Based Processing
- •Sample-Based Processing
- •Model Parameters in Alphabetical Order
- •Common Block Parameters
- •Continuous Library Block Parameters
- •Discontinuities Library Block Parameters
- •Discrete Library Block Parameters
- •Logic and Bit Operations Library Block Parameters
- •Lookup Tables Block Parameters
- •Math Operations Library Block Parameters
- •Model Verification Library Block Parameters
- •Model-Wide Utilities Library Block Parameters
- •Ports & Subsystems Library Block Parameters
- •Signal Attributes Library Block Parameters
- •Signal Routing Library Block Parameters
- •Sinks Library Block Parameters
- •Sources Library Block Parameters
- •User-Defined Functions Library Block Parameters
- •Additional Discrete Block Library Parameters
- •Additional Math: Increment - Decrement Block Parameters
- •Mask Parameters

Data Type
Data Type
enumeration
fixdt
fixptbestexp
fixptbestprec
fixpt_evenspace_cleanup
fixpt_interp1 fixpt_look1_func_approx
fixpt_look1_func_plot
fixpt_set_all
float
fxptdlg num2fixpt
sfix
Display or obtain enumerated type constituent values and names
Create Simulink.NumericType object describing fixed-point or floating-point data type
Exponent that gives best precision for fixed-point representation of value
Determine maximum precision available for fixed-point representation of value
Modify breakpoints of lookup table to have even spacing
Implement 1-D lookup table
Optimize fixed-point approximation of nonlinear function by interpolating lookup table data points
Plot fixed-point approximation function for lookup table
Set property for each fixed-point block in subsystem
Create MATLAB structure describing floating-point data type
Start Fixed-Point Tool
Convert number to nearest value representable by specified fixed-point data type
Create MATLAB structure describing signed generalized fixed-point data type
3-11

3 Function Reference
sfrac |
Create MATLAB structure |
|
describing signed fractional |
|
data type |
Simulink.defineIntEnumType |
Define enumerated data type |
sint |
Create MATLAB structure |
|
describing signed integer data |
|
type |
tunablevars2parameterobjects |
Create Simulink parameter objects |
|
from tunable parameters |
ufix |
Create MATLAB structure |
|
describing unsigned generalized |
|
fixed-point data type |
ufrac |
Create MATLAB structure |
|
describing unsigned fractional |
|
data type |
uint |
Create MATLAB structure |
|
describing unsigned integer |
|
data type |
3-12

4
Functions — Alphabetical
List

add_block
Purpose
Syntax
Description
Add block to model
add_block('src', 'dest')
block = add_block('src', 'dest') add_block('src', 'dest', 'param1', value1, ...) add_block('src', 'dest', 'MakeNameUnique', 'on')
add_block('src_inport', 'dest_inport', 'CopyOption', 'duplicate')
add_block('src', 'dest') copies the block with the full path name that you specify with 'src' to a new block with a full path name that you specify with 'dest'. The block parameters of the new block are identical to those of the original. If the 'src' block is a Subsystem block, then add_block copies all the blocks in the subsystem.
block = add_block('src', 'dest') returns the handle of the newly created block.
add_block('src', 'dest', 'param1', value1, ...) creates a copy of the 'src' block, with the named parameters having the specified values. Additional arguments must occur in parameter/value pairs.
add_block('src', 'dest', 'MakeNameUnique', 'on') creates a unique name for the new block, based on the name of the 'dest' block. The add_block function creates a unique name only if the 'dest' block name exists in the model into which you add the new block. By default, MakeNameUnique is off.
add_block('src_inport', 'dest_inport', 'CopyOption', 'duplicate') applies only to Inport blocks. It creates a copy with the same port number as the 'src_inport' block.
Before you add a block from a source model, open the source model. For example, use load_system (model opens invisibly) or open_system (model opens visibly). Also open the destination model if it is different from the source model.
Calling add_block triggers the CopyFnc and PreCopyFcn block callback functions.
4-2

add_block
Examples
You can use 'built-in/blocktype' as a source block path name for Simulink built-in blocks, where blocktype is the built-in block type (that is, the value of its BlockType parameter (see “Common Block Parameters” on page 8-96). However, using 'built-in/blocktype' causes some default parameter values of some blocks to be different from the defaults that you get if you added those blocks interactively using Simulink.
Copy the Scope block from the Sinks subsystem of the simulink system to a block named Scope in the Controller subsystem of the f14 system.
simulink; open_system('f14');
add_block('simulink/Sinks/Scope', 'f14/Controller/Scope')
Create a subsystem named Controller2 in the f14 system. You do not have to open the Library Browser.
open_system('f14'); add_block('built-in/SubSystem', 'f14/Controller2')
Copy the built-in Gain block to a block named Speed in the f14 system and assign the Gain parameter a value of 4. You do not have to open the Library Browser.
open_system('f14');
add_block('built-in/Gain', 'F14/Speed', 'Gain', '4')
Copy the block named Mu in vdp and create a copy. Because the model already contains a Mu block, the command names the new block Mu1. Open the vdp model, which is both the source and destination model, and get the handle of the added block.
4-3

add_block
open_system('vdp');
block = add_block('vdp/Mu', 'vdp/Mu', 'MakeNameUnique', 'on')
See Also |
delete_block | replace_block | set_param |
|
Tutorials |
• |
“Create Annotations Programmatically” |
How To |
• |
“Add Blocks to a Model” |
|
• |
“Create Model Callback Functions” |
4-4

add_exec_event_listener
Purpose
Syntax
Description
Register listener for block method execution event
h = add_exec_event_listener(blk, event, listener);
h = add_exec_event_listener(blk, event, listener) registers a listener for a block method execution event where the listener is a MATLAB program that performs some task, such as logging runtime data for a block, when the event occurs (see “Listen for Method Execution Events”). Simulink software invokes the registered listener whenever the specified event occurs during simulation of the model.
Note Simulink software can register a listener only while a simulation is running. Invoking this function when no simulation is running results in an error message. To ensure that a listener catches all relevant events triggered by a model’s simulation, you should register the listener in the model’s StartFcn callback function (see “Model Callback Functions”).
Input blk
Arguments
Specifies the block whose method execution event the listener is intended to handle. May be one of the following:
•Full pathname of a block
•A block handle
•A block runtime object (see “Access Block Data During Simulation”.)
event
Specifies the type of event for which the listener listens. It may be any of the following:
4-5

add_exec_event_listener
Output
Arguments
|
Event |
Occurs... |
|
|
'PreDerivatives' |
Before a block’s Derivatives |
|
|
|
method executes |
|
|
'PostDerivatives' |
After a block’s Derivatives |
|
|
|
method executes |
|
|
'PreOutputs' |
Before a block’s Outputs |
|
|
|
method executes. |
|
|
'PostOutputs' |
After a block’s Outputs method |
|
|
|
executes |
|
|
'PreUpdate' |
Before a block’s Update |
|
|
|
method executes |
|
|
'PostUpdate' |
After a block’s Update method |
|
|
|
executes |
|
listener
Specifies the listener to be registered. It may be either a string specifying a MATLAB expression, e.g., 'disp(''here'')' or a handle to a MATLAB function that accepts two arguments. The first argument is the block runtime object of the block that triggered the event. The second argument is an instance of EventData class that specifies the runtime object and the name of the event that just occurred.
add_exec_event_listener returns a handle to the listener that it registered. To stop listening for an event, use the MATLAB clear command to clear the listener handle from the workspace in which the listener was registered.
4-6

add_line
Purpose
Syntax
Description
Add line to Simulink system
h = add_line('sys','oport','iport')
h = add_line('sys','oport','iport', 'autorouting','on') h = add_line('sys', points)
The add_line command adds a line to the specified system and returns a handle to the new line. You can define the line in two ways:
•By naming the block ports that are to be connected by the line
•By specifying the location of the points that define the line segments
add_line('sys', 'oport', 'iport') adds a straight line to a system from the specified block output port 'oport' to the specified block input port 'iport'. 'oport' and 'iport' are strings consisting
of a block name and a port identifier in the form 'block/port'. Most block ports are identified by numbering the ports from top to bottom or from left to right, such as 'Gain/1' or 'Sum/2'.
Enable, Trigger, State, and Action ports are identified by name, such as 'subsystem_name/Enable', 'subsystem_name/Trigger', 'Integrator/State', or if_action_subsystem_name/Ifaction'.
add_line('sys','oport','iport', 'autorouting','on') works like add_line('sys','oport','iport') except that it routes the line around intervening blocks. The default value for autorouting is 'off'.
add_line(system, points) adds a segmented line to a system. Each row of the points array specifies the x and y coordinates of a point on a line segment. The origin is the top-left corner of the window. The signal flows from the point defined in the first row to the point defined in the last row. If the start of the new line is close to the output of an existing block or line, a connection is made. Likewise, if the end of the line is close to an existing input, a connection is made.
4-7