Documentation

Blocks

Alphabetical List By Category

Modeling

Block Libraries

Continuous

IntegratorIntegrate signal
DerivativeOutput time derivative of input
Integrator LimitedIntegrate signal
PID ControllerSimulate continuous- or discrete-time PID controllers
PID Controller (2 DOF)Simulate continuous- or discrete-time two-degree-of-freedom PID controllers
Second-Order Integrator Integrate input signal twice
Second-Order Integrator Limited Integrate input signal twice
State-SpaceImplement linear state-space system
Transfer FcnModel linear system by transfer function
Transport DelayDelay input by given amount of time
Variable Time DelayDelay input by variable amount of time
Variable Transport DelayDelay input by variable amount of time
Zero-PoleModel system by zero-pole-gain transfer function

Dashboard

Callback ButtonExecute MATLAB code based on user input
Check BoxSelect parameter or variable value
Combo BoxSelect parameter value from drop-down menu
Dashboard ScopeTrace signals during simulation
DisplayDisplay signal value during simulation
EditEnter new value for parameter
GaugeDisplay input value on circular scale
Half GaugeDisplay input value on semicircular scale
KnobTune parameter value with dial
LampDisplay color reflecting input value
Linear GaugeDisplay input value on linear scale
MultiStateImageDisplay image reflecting input value
Push ButtonSet value of parameter when button is pressed
Quarter GaugeDisplay input value on quadrant scale
Radio ButtonSelect parameter value
Rocker SwitchToggle parameter between two values
Rotary SwitchSwitch parameter to set values on dial
SliderTune parameter value with sliding scale
Slider SwitchToggle parameter between two values
Toggle SwitchToggle parameter between two values

Discontinuities

SaturationLimit range of signal
BacklashModel behavior of system with play
Coulomb and Viscous FrictionModel discontinuity at zero, with linear gain elsewhere
Dead ZoneProvide region of zero output
Dead Zone DynamicSet inputs within bounds to zero
Hit CrossingDetect crossing point
QuantizerDiscretize input at specified interval
Rate LimiterLimit rate of change of signal
Rate Limiter DynamicLimit rising and falling rates of signal
RelaySwitch output between two constants
Saturation DynamicBound range of input
Wrap To ZeroSet output to zero if input is above threshold

Discrete

Discrete-Time IntegratorPerform discrete-time integration or accumulation of signal
Unit DelayDelay signal one sample period
DelayDelay input signal by fixed or variable sample periods
DifferenceCalculate change in signal over one time step
Discrete DerivativeCompute discrete-time derivative
Discrete FIR FilterModel FIR filters
Discrete Filter Model Infinite Impulse Response (IIR) filters
Discrete PID ControllerSimulate continuous- or discrete-time PID controllers
Discrete PID Controller (2 DOF)Simulate continuous- or discrete-time two-degree-of-freedom PID controllers
Discrete State-SpaceImplement discrete state-space system
Discrete Transfer Fcn Implement discrete transfer function
Discrete Zero-PoleModel system defined by zeros and poles of discrete transfer function
First-Order HoldImplement first-order sample-and-hold
MemoryOutput input from previous time step
Resettable DelayDelay input signal by variable sample period and reset with external signal
Tapped DelayDelay scalar signal multiple sample periods and output all delayed versions
Transfer Fcn First OrderImplement discrete-time first order transfer function
Transfer Fcn Lead or LagImplement discrete-time lead or lag compensator
Transfer Fcn Real ZeroImplement discrete-time transfer function that has real zero and no pole
Variable Integer DelayDelay input signal by variable sample period
Zero-Order HoldImplement zero-order hold of one sample period

Logic and Bit Operations

Logical OperatorPerform specified logical operation on input
Relational OperatorPerform specified relational operation on inputs
Bit ClearSet specified bit of stored integer to zero
Bit SetSet specified bit of stored integer to one
Bitwise OperatorSpecified bitwise operation on inputs
Combinatorial LogicImplement truth table
Compare To ConstantDetermine how signal compares to specified constant
Compare To ZeroDetermine how signal compares to zero
Detect ChangeDetect change in signal value
Detect DecreaseDetect decrease in signal value
Detect Fall NegativeDetect falling edge when signal value decreases to strictly negative value, and its previous value was nonnegative
Detect Fall NonpositiveDetect falling edge when signal value decreases to nonpositive value, and its previous value was strictly positive
Detect IncreaseDetect increase in signal value
Detect Rise NonnegativeDetect rising edge when signal value increases to nonnegative value, and its previous value was strictly negative
Detect Rise PositiveDetect rising edge when signal value increases to strictly positive value, and its previous value was nonpositive
Extract BitsOutput selection of contiguous bits from input signal
Interval TestDetermine if signal is in specified interval
Interval Test DynamicDetermine if signal is in specified interval
Shift ArithmeticShift bits or binary point of signal

Lookup Tables

1-D Lookup TableApproximate one-dimensional function
2-D Lookup TableApproximate two-dimensional function
CosineImplement fixed-point sine or cosine wave using lookup table approach that exploits quarter wave symmetry
Direct Lookup Table (n-D)Index into N-dimensional table to retrieve element, column, or 2-D matrix
Interpolation Using PrelookupUse precalculated index and fraction values to accelerate approximation of N-dimensional function
Lookup Table DynamicApproximate one-dimensional function using dynamic table
PrelookupCompute index and fraction for Interpolation Using Prelookup block
SineImplement fixed-point sine or cosine wave using lookup table approach that exploits quarter wave symmetry
n-D Lookup TableApproximate N-dimensional function

Math Operations

GainMultiply input by constant
ProductMultiply and divide scalars and nonscalars or multiply and invert matrices
SumAdd or subtract inputs
Vector ConcatenateConcatenate input signals of same data type to create contiguous output signal
Slider GainVary scalar gain using slider
Dot ProductGenerate dot product of two vectors
Product of ElementsCopy or invert one scalar input, or collapse one nonscalar input
DivideDivide one input by another
AddAdd or subtract inputs
SubtractAdd or subtract inputs
Sum of ElementsAdd or subtract inputs
AbsOutput absolute value of input
Math FunctionPerform mathematical function
Trigonometric FunctionSpecified trigonometric function on input
Rounding FunctionApply rounding function to signal
SignIndicate sign of input
SqrtCalculate square root, signed square root, or reciprocal of square root
Signed SqrtCalculate square root, signed square root, or reciprocal of square root
Reciprocal SqrtCalculate square root, signed square root, or reciprocal of square root
Algebraic ConstraintConstrain input signal
AssignmentAssign values to specified elements of signal
BiasAdd bias to input
Complex to Magnitude-AngleCompute magnitude and/or phase angle of complex signal
Complex to Real-ImagOutput real and imaginary parts of complex input signal
Find Find nonzero elements in array
Magnitude-Angle to ComplexConvert magnitude and/or a phase angle signal to complex signal
Matrix ConcatenateConcatenate input signals of same data type to create contiguous output signal
MinMaxOutput minimum or maximum input value
MinMax Running ResettableDetermine minimum or maximum of signal over time
Permute DimensionsRearrange dimensions of multidimensional array dimensions
PolynomialPerform evaluation of polynomial coefficients on input values
Real-Imag to ComplexConvert real and/or imaginary inputs to complex signal
ReshapeChange dimensionality of signal
Sine Wave FunctionGenerate sine wave, using external signal as time source
SqueezeRemove singleton dimensions from multidimensional signal
Unary MinusNegate input
Weighted Sample Time MathSupport calculations involving sample time

Model Verification

AssertionCheck whether signal is zero
Check Dynamic GapCheck that gap of possibly varying width occurs in range of signal's amplitudes
Check Dynamic RangeCheck that signal falls inside range of amplitudes that varies from time step to time step
Check Static GapCheck that gap exists in signal's range of amplitudes
Check Static RangeCheck that signal falls inside fixed range of amplitudes
Check Discrete GradientCheck that absolute value of difference between successive samples of discrete signal is less than upper bound
Check Dynamic Lower BoundCheck that one signal is always less than another signal
Check Dynamic Upper BoundCheck that one signal is always greater than another signal
Check Input ResolutionCheck that input signal has specified resolution
Check Static Lower BoundCheck that signal is greater than (or optionally equal to) static lower bound
Check Static Upper BoundCheck that signal is less than (or optionally equal to) static upper bound

Model-Wide Utilities

Block Support TableView data type support for Simulink blocks
DocBlockCreate text that documents model and save text with model
Model InfoDisplay model properties and text in model
Timed-Based LinearizationGenerate linear models in base workspace at specific times
Trigger-Based LinearizationGenerate linear models in base workspace when triggered

Ports and Subsystems

Inport Create input port for subsystem or external input
OutportCreate output port for subsystem or external output
SubsystemGroup blocks to create model hierarchy
Unit System ConfigurationConfigure units
ModelInclude multiple model implementations as block in another model
Model VariantsInclude multiple model implementations as block in another model
Variant SubsystemTemplate subsystem containing Subsystem blocks as variant choices
Configurable SubsystemRepresent any block selected from user-specified library of blocks
Atomic SubsystemGroup blocks to create model hierarchy
CodeReuse SubsystemGroup blocks to create model hierarchy
Enabled SubsystemSubsystem whose execution is enabled by external input
Triggered SubsystemSubsystem whose execution is triggered by external input
Enabled and Triggered SubsystemSubsystem whose execution is enabled and triggered by external input
Resettable Subsystem Subsystem whose block states reset with external trigger
If Action SubsystemSubsystem whose execution is triggered by If block
Switch Case Action SubsystemSubsystem whose execution is triggered by Switch Case block
For Iterator SubsystemSubsystem that repeats execution during a simulation time step
For Each SubsystemSubsystem that repeats execution on each element or subarray of input signal and concatenates results
While Iterator SubsystemSubsystem that repeats execution during a simulation time step
TriggerAdd trigger port to subsystem or model
Action PortImplement Action subsystems used in if and switch control flow statements
EnableAdd enable port to subsystem or model
ResetAdd reset port to subsystem
For EachProcess elements or subarrays of a mask parameter or input signal independently
For IteratorRepeatedly execute contents of subsystem at current time step until iteration variable exceeds specified iteration limit
IfModel if-else control flow
Switch CaseImplement C-like switch control flow statement
While IteratorRepeat execution of a subsystem while a logical condition signal is true
Function-Call SubsystemSubsystem whose execution is triggered by external function call input
Function-Call Feedback LatchBreak feedback loop involving data signals between function-call blocks
Function-Call GeneratorProvide function-call signal to control execution of a subsystem or model
Function-Call SplitProvide junction for splitting function-call signal

Signal Attributes

Data Type ConversionConvert input signal to specified data type
Bus to VectorConvert virtual bus to vector
Data Type Conversion InheritedConvert from one data type to another using inherited data type and scaling
Data Type DuplicateForce all inputs to same data type
Data Type PropagationSet data type and scaling of propagated signal based on information from reference signals
Data Type Scaling StripRemove scaling and map to built in integer
ICSet initial value of signal
ProbeOutput signal attributes, including width, dimensionality, sample time, and complex signal flag
Rate TransitionHandle transfer of data between blocks operating at different rates
Signal ConversionConvert signal to new type without altering signal values
Signal SpecificationSpecify desired dimensions, sample time, data type, numeric type, and other attributes of signal
Weighted Sample TimeSupport calculations involving sample time
WidthOutput width of input vector
Unit ConversionConvert units

Signal Routing

Bus CreatorCreate bus signal from input signals
Bus SelectorSelect signals from incoming bus
DemuxExtract and output elements of virtual vector signal
MuxCombine input signals of same data type and numeric type into virtual vector
SwitchSwitch output between first input and third input based on value of second input
Bus AssignmentReplace specified bus elements
Data Store MemoryDefine data store
Data Store ReadRead data from data store
Data Store WriteWrite data to data store
Environment ControllerCreate branches of block diagram that apply only to simulation or only to code generation
FromAccept input from Goto block
GotoPass block input to From blocks
Goto Tag VisibilityDefine scope of Goto block tag
Index VectorSwitch output between different inputs based on value of first input
Manual Switch Switch between two inputs
MergeCombine multiple signals into single signal
Multiport Switch Choose between multiple block inputs
SelectorSelect input elements from vector, matrix, or multidimensional signal
Vector ConcatenateConcatenate input signals of same data type to create contiguous output signal
Variant SourceRoute amongst multiple inputs using variants
Variant SinkRoute amongst multiple outputs using variants
Manual Variant SourceSwitch amongst multiple variant choices at input
Manual Variant SinkSwitch amongst multiple variant choices at output

Sinks

OutportCreate output port for subsystem or external output
ScopeDisplay signals generated during simulation
TerminatorTerminate unconnected output port
DisplayShow value of input
Floating ScopeDisplay signals generated during simulation
Stop SimulationStop simulation when input is nonzero
To FileWrite data to file
To WorkspaceWrite data to workspace
XY GraphDisplay X-Y plot of signals using MATLAB figure window

Sources

ConstantGenerate constant value
GroundGround unconnected input port
Inport Create input port for subsystem or external input
Signal BuilderCreate and generate interchangeable groups of signals whose waveforms are piecewise linear
Sine WaveGenerate sine wave, using simulation time as time source
Band-Limited White NoiseIntroduce white noise into continuous system
Chirp SignalGenerate sine wave with increasing frequency
ClockDisplay and provide simulation time
Counter Free-RunningCount up and overflow back to zero after reaching maximum value for specified number of bits
Counter LimitedCount up and wrap back to zero after outputting specified upper limit
Digital ClockOutput simulation time at specified sampling interval
Enumerated ConstantGenerate enumerated constant value
From FileLoad data from MAT-file
From SpreadsheetRead data from spreadsheet
Pulse GeneratorGenerate square wave pulses at regular intervals
RampGenerate constantly increasing or decreasing signal
Random NumberGenerate normally distributed random numbers
Repeating SequenceGenerate arbitrarily shaped periodic signal
Repeating Sequence InterpolatedOutput discrete-time sequence and repeat, interpolating between data points
Repeating Sequence StairOutput and repeat discrete time sequence
Signal EditorDisplay, create, edit, and switch interchangeable scenarios
Signal GeneratorGenerate various waveforms
StepGenerate step function
Uniform Random NumberGenerate uniformly distributed random numbers
Waveform GeneratorOutput waveforms using signal notations

User-Defined Functions

Argument InportArgument input port for Simulink Function block
Argument OutportArgument output port for Simulink Function block
Event ListenerAdd event port to a subsystem block
FcnApply specified expression to input
Function CallerCall Simulink or exported Stateflow function
Initialize FunctionExecutes contents on a model initialize event
Interpreted MATLAB FunctionApply MATLAB function or expression to input
Level-2 MATLAB S-FunctionUse Level-2 MATLAB S-function in model
MATLAB FunctionInclude MATLAB code in models that generate embeddable C code
MATLAB SystemInclude System object in model
Reset FunctionExecutes contents on a model reset event
S-FunctionInclude S-function in model
S-Function BuilderCreate S-function from C code that you provide
Simulink FunctionFunction defined with Simulink blocks
State ReaderRead a block state
State WriterWrite to a block state
Terminate FunctionExecute contents on a model terminate event

Additional Math and Discrete

Fixed-Point State-SpaceImplement discrete-time state space
Transfer Fcn Direct Form IIImplement Direct Form II realization of transfer function
Transfer Fcn Direct Form II Time VaryingImplement time varying Direct Form II realization of transfer function
Decrement Real WorldDecrease real world value of signal by one
Decrement Stored IntegerDecrease stored integer value of signal by one
Decrement Time To ZeroDecrease real-world value of signal by sample time, but only to zero
Decrement To ZeroDecrease real-world value of signal by one, but only to zero
Increment Real WorldIncrease real world value of signal by one
Increment Stored IntegerIncrease stored integer value of signal by one

HDL Coder

Discrete
DelayDelay input signal by fixed or variable sample periods
Discrete FIR FilterModel FIR filters
Discrete PID ControllerSimulate continuous- or discrete-time PID controllers
Discrete-Time IntegratorPerform discrete-time integration or accumulation of signal
Discrete Transfer Fcn Implement discrete transfer function
MemoryOutput input from previous time step
Resettable DelayDelay input signal by variable sample period and reset with external signal
Tapped DelayDelay scalar signal multiple sample periods and output all delayed versions
Unit DelayDelay signal one sample period
Unit Delay Enabled Resettable SynchronousDelay input signal by one sample period when external Enable signal is true and external Reset signal is false
Unit Delay Enabled SynchronousDelay input signal by one sample period when external Enable signal is true
Unit Delay Resettable SynchronousDelay input signal by one sample period when external Reset signal is false
Zero-Order HoldImplement zero-order hold of one sample period
HDL Subsystems
State ControlSpecify synchronous reset and enable behavior for blocks with state
Synchronous SubsystemRepresent subsystem that has synchronous reset and enable behavior
Enabled Synchronous SubsystemRepresent enabled subsystem that has synchronous reset and enable behavior
Resettable Synchronous SubsystemRepresent resettable subsystem that has synchronous reset and enable behavior
HDL Operations
HDL ReciprocalCalculate reciprocal with Newton-Raphson approximation method
Multiply-AddMultiply-add combined operation
Multiply-AccumulatePerform a multiply-accumulate operation on the inputs
Serializer1DConvert vector signal to scalar or smaller vectors
Deserializer1DConvert scalar stream or smaller vectors to vector signal
HDL RAMs
Dual Port RAMDual port RAM with two output ports
Dual Rate Dual Port RAMDual Port RAM that supports two rates
Simple Dual Port RAMDual port RAM with single output port
Single Port RAMSingle port RAM
HDL FIFOStores sequence of input samples in first in, first out (FIFO) register
Dual Port RAM System, Simple Dual Port RAM System, Single Port RAM SystemRAM blocks based on the hdl.RAM system object with ability to provide initial value
HDL Floating Point Operations
AbsOutput absolute value of input
AddAdd or subtract inputs
SubtractAdd or subtract inputs
Sum of ElementsAdd or subtract inputs
DivideDivide one input by another
Product of ElementsCopy or invert one scalar input, or collapse one nonscalar input
SumAdd or subtract inputs
ProductMultiply and divide scalars and nonscalars or multiply and invert matrices
GainMultiply input by constant
Math FunctionPerform mathematical function
Trigonometric FunctionSpecified trigonometric function on input
Data Type ConversionConvert input signal to specified data type
Discrete FIR FilterModel FIR filters
Discrete PID ControllerSimulate continuous- or discrete-time PID controllers
Discrete-Time IntegratorPerform discrete-time integration or accumulation of signal
Discrete Transfer Fcn Implement discrete transfer function
Float TypecastTypecast a floating-point type to an unsigned integer or vice versa
Rounding FunctionApply rounding function to signal
Logic and Bit Operations
Bit ClearSet specified bit of stored integer to zero
Bit ConcatConcatenates up to 128 input words into single output
Bit ReduceAND, OR, or XOR bit reduction on all input signal bits to single bit
Bit RotateRotate input signal by bit positions
Bit SetSet specified bit of stored integer to one
Bit ShiftLogical or arithmetic shift of input signal
Bit SliceReturn field of consecutive bits from input signal
Bitwise OperatorSpecified bitwise operation on inputs
Compare To ConstantDetermine how signal compares to specified constant
Compare To ZeroDetermine how signal compares to zero
Extract BitsOutput selection of contiguous bits from input signal
Logical OperatorPerform specified logical operation on input
Relational OperatorPerform specified relational operation on inputs
Shift ArithmeticShift bits or binary point of signal
Lookup Tables
1-D Lookup TableApproximate one-dimensional function
2-D Lookup TableApproximate two-dimensional function
Direct Lookup Table (n-D)Index into N-dimensional table to retrieve element, column, or 2-D matrix
Interpolation Using PrelookupUse precalculated index and fraction values to accelerate approximation of N-dimensional function
Lookup Table DynamicApproximate one-dimensional function using dynamic table
PrelookupCompute index and fraction for Interpolation Using Prelookup block
n-D Lookup TableApproximate N-dimensional function
Cosine HDL OptimizedImplement fixed-point cosine wave optimized for HDL code generation
Sine HDL OptimizedImplement fixed-point sine wave by using lookup table approach that exploits quarter wave symmetry
Sources
ConstantGenerate constant value
Counter Free-RunningCount up and overflow back to zero after reaching maximum value for specified number of bits
Counter LimitedCount up and wrap back to zero after outputting specified upper limit
Enumerated ConstantGenerate enumerated constant value
GroundGround unconnected input port
HDL CounterFree-running or count-limited hardware counter
Inport Create input port for subsystem or external input

Design Models

Model Hierarchy

SubsystemGroup blocks to create model hierarchy
ModelInclude multiple model implementations as block in another model

Nonlinearity

1-D Lookup TableApproximate one-dimensional function
2-D Lookup TableApproximate two-dimensional function
Direct Lookup Table (n-D)Index into N-dimensional table to retrieve element, column, or 2-D matrix
Interpolation Using PrelookupUse precalculated index and fraction values to accelerate approximation of N-dimensional function
Lookup Table DynamicApproximate one-dimensional function using dynamic table
n-D Lookup TableApproximate N-dimensional function
PrelookupCompute index and fraction for Interpolation Using Prelookup block
Sine, CosineImplement fixed-point sine or cosine wave using lookup table approach that exploits quarter wave symmetry

Logically Executed Subsystems

If Action SubsystemSubsystem whose execution is triggered by If block
IfModel if-else control flow
Switch Case Action SubsystemSubsystem whose execution is triggered by Switch Case block
Switch CaseImplement C-like switch control flow statement
Action PortImplement Action subsystems used in if and switch control flow statements
While Iterator SubsystemSubsystem that repeats execution during a simulation time step
While IteratorRepeat execution of a subsystem while a logical condition signal is true
For Iterator SubsystemSubsystem that repeats execution during a simulation time step
For IteratorRepeatedly execute contents of subsystem at current time step until iteration variable exceeds specified iteration limit
For Each SubsystemSubsystem that repeats execution on each element or subarray of input signal and concatenates results
For EachProcess elements or subarrays of a mask parameter or input signal independently

Conditionally Executed Subsystems

Enabled SubsystemSubsystem whose execution is enabled by external input
Triggered SubsystemSubsystem whose execution is triggered by external input
Enabled and Triggered SubsystemSubsystem whose execution is enabled and triggered by external input
EnableAdd enable port to subsystem or model
TriggerAdd trigger port to subsystem or model
Function-Call SubsystemSubsystem whose execution is triggered by external function call input
Function-Call GeneratorProvide function-call signal to control execution of a subsystem or model
Function-Call SplitProvide junction for splitting function-call signal
Function-Call Feedback LatchBreak feedback loop involving data signals between function-call blocks
TriggerAdd trigger port to subsystem or model
Initialize FunctionExecutes contents on a model initialize event
Reset FunctionExecutes contents on a model reset event
Terminate FunctionExecute contents on a model terminate event
Event ListenerAdd event port to a subsystem block
State ReaderRead a block state
State WriterWrite to a block state
Resettable Subsystem Subsystem whose block states reset with external trigger
ResetAdd reset port to subsystem

Simulink Functions in Simulink Models

Simulink FunctionFunction defined with Simulink blocks
Argument InportArgument input port for Simulink Function block
Argument OutportArgument output port for Simulink Function block
Function CallerCall Simulink or exported Stateflow function
MATLAB FunctionInclude MATLAB code in models that generate embeddable C code
ChartImplement control logic with finite state machine
Inport Create input port for subsystem or external input
OutportCreate output port for subsystem or external output

Configure Models

Signals

Signal SpecificationSpecify desired dimensions, sample time, data type, numeric type, and other attributes of signal
Bus to VectorConvert virtual bus to vector
ICSet initial value of signal
ProbeOutput signal attributes, including width, dimensionality, sample time, and complex signal flag
Rate TransitionHandle transfer of data between blocks operating at different rates
Signal ConversionConvert signal to new type without altering signal values
Weighted Sample TimeSupport calculations involving sample time
WidthOutput width of input vector

Units in Simulink

Inport Create input port for subsystem or external input
OutportCreate output port for subsystem or external output
Signal SpecificationSpecify desired dimensions, sample time, data type, numeric type, and other attributes of signal
Unit System ConfigurationConfigure units
Unit ConversionConvert units

Data Types

Block Support TableView data type support for Simulink blocks
Data Type ConversionConvert input signal to specified data type
Data Type Conversion InheritedConvert from one data type to another using inherited data type and scaling
Data Type DuplicateForce all inputs to same data type
Data Type PropagationSet data type and scaling of propagated signal based on information from reference signals
Data Type Scaling StripRemove scaling and map to built in integer

Annotate Models

DocBlockCreate text that documents model and save text with model
Model InfoDisplay model properties and text in model

Transform Models

Trimming and Linearization

Timed-Based LinearizationGenerate linear models in base workspace at specific times
Trigger-Based LinearizationGenerate linear models in base workspace when triggered

Simulation

Prepare Model Inputs and Outputs

Load Signal Data for Simulation

Inport Create input port for subsystem or external input
EnableAdd enable port to subsystem or model
TriggerAdd trigger port to subsystem or model
From FileLoad data from MAT-file
From SpreadsheetRead data from spreadsheet
From WorkspaceLoad signal data from workspace
Signal BuilderCreate and generate interchangeable groups of signals whose waveforms are piecewise linear

Save Runtime Data from Simulation

OutportCreate output port for subsystem or external output
To FileWrite data to file
To WorkspaceWrite data to workspace

View and Analyze Simulation Results

View Simulation Results

ScopeDisplay signals generated during simulation
Floating ScopeDisplay signals generated during simulation
XY GraphDisplay X-Y plot of signals using MATLAB figure window

Control Simulations with Interactive Displays

Dashboard ScopeTrace signals during simulation
DisplayDisplay signal value during simulation
GaugeDisplay input value on circular scale
Half GaugeDisplay input value on semicircular scale
Linear GaugeDisplay input value on linear scale
Quarter GaugeDisplay input value on quadrant scale
LampDisplay color reflecting input value
MultiStateImageDisplay image reflecting input value
EditEnter new value for parameter
KnobTune parameter value with dial
SliderTune parameter value with sliding scale
Push ButtonSet value of parameter when button is pressed
Rotary SwitchSwitch parameter to set values on dial
Radio ButtonSelect parameter value
Combo BoxSelect parameter value from drop-down menu
Check BoxSelect parameter or variable value
Rocker SwitchToggle parameter between two values
Slider SwitchToggle parameter between two values
Toggle SwitchToggle parameter between two values
Callback ButtonExecute MATLAB code based on user input

Test and Debug Simulations

Component Testing

Component-Based Modeling

Model Architecture

Subsystems

SubsystemGroup blocks to create model hierarchy

Libraries

SubsystemGroup blocks to create model hierarchy
Unresolved LinkIndicate unresolved reference to library block

Model Referencing

ModelInclude multiple model implementations as block in another model

Data Stores

Data Store MemoryDefine data store
Data Store ReadRead data from data store
Data Store WriteWrite data to data store

Composite Signals

Bus AssignmentReplace specified bus elements
Bus CreatorCreate bus signal from input signals
Bus SelectorSelect signals from incoming bus
In Bus Element Select bus element or entire bus that is connected to subsystem input port
Out Bus ElementOutput signals from a subsystem as a virtual bus
Bus to VectorConvert virtual bus to vector
DemuxExtract and output elements of virtual vector signal
MuxCombine input signals of same data type and numeric type into virtual vector

Variant Systems

Variant SubsystemTemplate subsystem containing Subsystem blocks as variant choices
Variant ModelTemplate subsystem containing Subsystem blocks as variant choices
Variant SourceRoute amongst multiple inputs using variants
Variant SinkRoute amongst multiple outputs using variants
Manual Variant SourceSwitch amongst multiple variant choices at input
Manual Variant SinkSwitch amongst multiple variant choices at output
Model VariantsInclude multiple model implementations as block in another model

Block Creation

Block Creation Basics

FcnApply specified expression to input
Function CallerCall Simulink or exported Stateflow function
Interpreted MATLAB FunctionApply MATLAB function or expression to input
Level-2 MATLAB S-FunctionUse Level-2 MATLAB S-function in model
MATLAB FunctionInclude MATLAB code in models that generate embeddable C code
MATLAB SystemInclude System object in model
S-FunctionInclude S-function in model
S-Function BuilderCreate S-function from C code that you provide
Simulink FunctionFunction defined with Simulink blocks

Custom MATLAB Algorithms

MATLAB Algorithm Design

Language, Function, and Object Support
MATLAB FunctionInclude MATLAB code in models that generate embeddable C code
MATLAB SystemInclude System object in model
Data Definition
Data Definition Basics
MATLAB FunctionInclude MATLAB code in models that generate embeddable C code
MATLAB SystemInclude System object in model
Variable-Size Data
MATLAB FunctionInclude MATLAB code in models that generate embeddable C code
MATLAB SystemInclude System object in model
Structures
MATLAB FunctionInclude MATLAB code in models that generate embeddable C code
MATLAB SystemInclude System object in model
Enumerations
MATLAB FunctionInclude MATLAB code in models that generate embeddable C code
MATLAB Classes
MATLAB FunctionInclude MATLAB code in models that generate embeddable C code
MATLAB SystemInclude System object in model
Function Handles
MATLAB FunctionInclude MATLAB code in models that generate embeddable C code
MATLAB SystemInclude System object in model
Function Definition
MATLAB FunctionInclude MATLAB code in models that generate embeddable C code
MATLAB SystemInclude System object in model

MATLAB Algorithm Integration

MATLAB FunctionInclude MATLAB code in models that generate embeddable C code

Code Generation

MATLAB FunctionInclude MATLAB code in models that generate embeddable C code

Performance

MATLAB FunctionInclude MATLAB code in models that generate embeddable C code

S-Functions

S-Function Basics

S-FunctionInclude S-function in model
S-Function BuilderCreate S-function from C code that you provide

C/C++ S-Functions

Create C/C++ S-Functions
S-FunctionInclude S-function in model
S-Function BuilderCreate S-function from C code that you provide

MATLAB S-Functions

S-FunctionInclude S-function in model

Fortran S-Functions

S-FunctionInclude S-function in model

FMU Importing

FMUInclude Functional Mockup Unit (FMU) in model

System Object Integration

Implement Blocks with System Objects

MATLAB SystemInclude System object in model
Was this topic helpful?