| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Real-Time Workshop |
| Contents | Index |
| Learn more about Real-Time Workshop |
The following tables summarize Real-Time Workshop and Real-Time Workshop Embedded Coder support for Simulink blocks. There is a table for each block library. For each block, the second column indicates any support notes, which give information about the block for code generation. For more detail, including data types each block supports, in the MATLAB Command Window, type showblockdatatypetable, or consult the block reference pages.
Additional Math and Discrete: Additional Discrete
| Block | Support Notes |
|---|---|
| Fixed-Point State-Space | The Real-Time Workshop software does not explicitly group primitive blocks that constitute a nonatomic masked subsystem block in the generated code. This flexibility allows for more efficient code generation. In certain cases, you can achieve grouping by configuring the masked subsystem block to execute as an atomic unit by selecting the Treat as atomic unit option. |
| Transfer Fcn Direct Form II |
|
| Transfer Fcn Direct Form II Time Varying | |
| Unit Delay Enabled | |
| Unit Delay Enabled External IC | |
| Unit Delay Enabled Resettable | |
| Unit Delay Enabled Resettable External IC | |
| Unit Delay External IC | |
| Unit Delay Resettable | |
| Unit Delay Resettable External IC | |
| Unit Delay With Preview Enabled | |
| Unit Delay With Preview Enabled Resettable | |
| Unit Delay With Preview Enabled Resettable External RV | |
| Unit Delay With Preview Resettable | |
| Unit Delay With Preview Resettable External RV |
Additional Math and Discrete: Increment/Decrement
| Block | Support Notes |
|---|---|
| Decrement Real World | The Real-Time Workshop software does not explicitly group primitive blocks that constitute a nonatomic masked subsystem block in the generated code. This flexibility allows for more efficient code generation. In certain cases, you can achieve grouping by configuring the masked subsystem block to execute as an atomic unit by selecting the Treat as atomic unit option. |
| Decrement Stored Integer | |
| Decrement Time To Zero | Supports code generation. |
| Decrement To Zero | The Real-Time Workshop software does not explicitly group primitive blocks that constitute a nonatomic masked subsystem block in the generated code. This flexibility allows for more efficient code generation. In certain cases, you can achieve grouping by configuring the masked subsystem block to execute as an atomic unit by selecting the Treat as atomic unit option. |
| Increment Real World | |
| Increment Stored Integer |
Continuous
| Block | Support Notes |
|---|---|
| Derivative |
|
| Integrator | |
| PID Controller | |
| PID Controller (2DOF) | |
| State-Space | |
| Transfer Fcn | |
| Transport Delay | |
| Variable Time Delay | |
| Variable Transport Delay | |
| Zero-Pole |
Discontinuities
| Block | Support Notes |
|---|---|
| Backlash | Generated code might rely on memcpy or memset (string.h). |
| Coulomb and Viscous Friction | The Real-Time Workshop software does not explicitly group primitive blocks that constitute a nonatomic masked subsystem block in the generated code. This flexibility allows for more efficient code generation. In certain cases, you can achieve grouping by configuring the masked subsystem block to execute as an atomic unit by selecting the Treat as atomic unit option. |
| Dead Zone | Supports code generation. |
| Dead Zone Dynamic | The Real-Time Workshop software does not explicitly group primitive blocks that constitute a nonatomic masked subsystem block in the generated code. This flexibility allows for more efficient code generation. In certain cases, you can achieve grouping by configuring the masked subsystem block to execute as an atomic unit by selecting the Treat as atomic unit option. |
| Hit Crossing | Not recommended for production code. Relates to resource limits and restrictions on speed and memory often found in embedded systems. Generated code can contain dynamic allocation and freeing of memory, recursion, additional memory overhead, and widely-varying execution times. While the code is functionally correct and generally acceptable in resource-rich environments, smaller embedded targets often cannot support such code. Usually, blocks evolve toward being suitable for production code. Thus, blocks suitable for production code remain suitable. |
| Quantizer | Supports code generation. |
| Rate Limiter | Cannot use inside a triggered subsystem hierarchy. |
| Rate Limiter Dynamic | The Real-Time Workshop software does not explicitly group primitive blocks that constitute a nonatomic masked subsystem block in the generated code. This flexibility allows for more efficient code generation. In certain cases, you can achieve grouping by configuring the masked subsystem block to execute as an atomic unit by selecting the Treat as atomic unit option. |
| Relay | Support code generation. |
| Saturation | |
| Saturation Dynamic | The Real-Time Workshop software does not explicitly group primitive blocks that constitute a nonatomic masked subsystem block in the generated code. This flexibility allows for more efficient code generation. In certain cases, you can achieve grouping by configuring the masked subsystem block to execute as an atomic unit by selecting the Treat as atomic unit option. |
| Wrap To Zero |
Discrete
| Block | Support Notes |
|---|---|
| Difference |
|
| Discrete Derivative |
|
| Discrete Filter | Support code generation. |
| Discrete FIR Filter | |
| PID Controller |
|
| PID Controller (2DOF) | |
| Discrete State-Space | Generated code might rely on memcpy or memset (string.h). |
| Discrete Transfer Fcn | |
| Discrete Zero-Pole | |
| Discrete-Time Integrator | Depends on absolute time when used inside a triggered subsystem hierarchy. |
| First-Order Hold | Not recommended for production code. Relates to resource limits and restrictions on speed and memory often found in embedded systems. Generated code can contain dynamic allocation and freeing of memory, recursion, additional memory overhead, and widely-varying execution times. While the code is functionally correct and generally acceptable in resource-rich environments, smaller embedded targets often cannot support such code. Usually, blocks evolve toward being suitable for production code. Thus, blocks suitable for production code remain suitable. |
| Integer Delay | Support code generation. |
| Memory | |
| Tapped Delay | |
| Transfer Fcn First Order | The Real-Time Workshop software does not explicitly group primitive blocks that constitute a nonatomic masked subsystem block in the generated code. This flexibility allows for more efficient code generation. In certain cases, you can achieve grouping by configuring the masked subsystem block to execute as an atomic unit by selecting the Treat as atomic unit option. |
| Transfer Fcn Lead or Lag | |
| Transfer Fcn Real Zero | |
| Unit Delay | Generated code might rely on memcpy or memset (string.h). |
| Zero-Order Hold | Supports code generation. |
Logic and Bit Operations
| Block | Support Notes |
|---|---|
| Bit Clear | Support code generation. |
| Bit Set | |
| Bitwise Operator | |
| Combinatorial Logic | |
| Compare to Constant | |
| Compare to Zero | |
| Detect Change | Generated code might rely on memcpy or memset (string.h). |
| Detect Decrease | |
| Detect Fall Negative | |
| Detect Fall Nonpositive | |
| Detect Increase | |
| Detect Rise Nonnegative | |
| Detect Rise Positive | |
| Extract Bits | Support code generation. |
| Interval Test | |
| Interval Test Dynamic | |
| Logical Operator | |
| Relational Operator | |
| Shift Arithmetic |
Lookup Tables
| Block | Support Notes |
|---|---|
| Cosine | The Real-Time Workshop software does not explicitly group primitive blocks that constitute a nonatomic masked subsystem block in the generated code. This flexibility allows for more efficient code generation. In certain cases, you can achieve grouping by configuring the masked subsystem block to execute as an atomic unit by selecting the Treat as atomic unit option. |
| Direct Lookup Table (n-D) | Support code generation. |
| Interpolation Using Prelookup | |
| Lookup Table | |
| Lookup Table (2-D) | |
| Lookup Table (n-D) | |
| Lookup Table Dynamic | |
| Prelookup | |
| Sine | The Real-Time Workshop software does not explicitly group primitive blocks that constitute a nonatomic masked subsystem block in the generated code. This flexibility allows for more efficient code generation. In certain cases, you can achieve grouping by configuring the masked subsystem block to execute as an atomic unit by selecting the Treat as atomic unit option. |
Math Operations
| Block | Support Notes |
|---|---|
| Abs | Support code generation. |
| Add | |
| Algebraic Constraint | Ignored during code generation. |
| Assignment | Support code generation. |
| Bias | |
| Complex to Magnitude-Angle | |
| Complex to Real-Imag | |
| Divide | |
| Dot Product | |
| Gain | |
| Magnitude-Angle to Complex | |
| Math Function (10^u) | |
| Math Function (conj) | |
| Math Function (exp) | |
| Math Function (hermitian) | |
| Math Function (hypot) | |
| Math Function (log) | |
| Math Function (log10) | |
| Math Function (magnitude^2) | |
| Math Function (mod) | |
| Math Function (pow) | |
| Math Function (reciprocal) | |
| Math Function (rem) | |
| Math Function (square) | |
| Math Function (sqrt) | |
| Math Function (1/sqrt) | |
| Math Function (transpose) | |
| Matrix Concatenate | |
| MinMax | |
| MinMax Running Resettable | |
| Permute Dimensions | |
| Polynomial | |
| Product | |
| Product of Elements | |
| Real-Imag to Complex | |
| Reshape | |
| Rounding Function | |
| Sign | |
| Sine Wave Function |
|
| Slider Gain | Support code generation. |
| Squeeze | |
| Subtract | |
| Sum | |
| Sum of Elements | |
| Trigonometric Function | Functions asinh, acosh, and atanh are not supported by all compilers. If you use a compiler that does not support the functions, the Real-Time Workshop software issues a warning message for the block and the generated code fails to link. |
| Unary Minus | Support code generation. |
| Vector Concatenate | |
| Weighted Sample Time Math |
Model Verification
| Block | Support Notes |
|---|---|
| Assertion | Supports code generation. |
| Check Discrete Gradient | Not recommended for production code. Relates to resource limits and restrictions on speed and memory often found in embedded systems. Generated code can contain dynamic allocation and freeing of memory, recursion, additional memory overhead, and widely-varying execution times. While the code is functionally correct and generally acceptable in resource-rich environments, smaller embedded targets often cannot support such code. Usually, blocks evolve toward being suitable for production code. Thus, blocks suitable for production code remain suitable. |
| Check Dynamic Gap | Support code generation. |
| Check Dynamic Lower Bound | |
| Check Dynamic Range | |
| Check Dynamic Upper Bound | |
| Check Input Resolution | Not recommended for production code. Relates to resource limits and restrictions on speed and memory often found in embedded systems. Generated code can contain dynamic allocation and freeing of memory, recursion, additional memory overhead, and widely-varying execution times. While the code is functionally correct and generally acceptable in resource-rich environments, smaller embedded targets often cannot support such code. Usually, blocks evolve toward being suitable for production code. Thus, blocks suitable for production code remain suitable. |
| Check Static Gap | |
| Check Static Lower Bound | |
| Check Static Range | |
| Check Static Upper Bound |
Model-Wide Utilities
| Block | Support Notes |
|---|---|
| Block Support Table | Ignored during code generation. |
| DocBlock | Uses the template symbol you specify for the RTW Embedded Coder Flag block parameter to add comments to generated code. Requires a Real-Time Workshop Embedded Coder license. For more information, see Using a Simulink DocBlock to Add a Comment. |
| Model Info | Ignored during code generation. |
| Time-Based Linearization | |
| Trigger-Based Linearization |
Ports & Subsystems
Signal Attributes
| Block | Support Notes |
|---|---|
| Bus to Vector | Support code generation. |
| Data Type Conversion | |
| Data Type Conversion Inherited | |
| Data Type Duplicate | |
| Data Type Propagation | |
| Data Type Scaling Strip | |
| IC | Not recommended for production code. Relates to resource limits and restrictions on speed and memory often found in embedded systems. Generated code can contain dynamic allocation and freeing of memory, recursion, additional memory overhead, and widely-varying execution times. While the code is functionally correct and generally acceptable in resource-rich environments, smaller embedded targets often cannot support such code. Usually, blocks evolve toward being suitable for production code. Thus, blocks suitable for production code remain suitable. |
| Probe | Supports code generation. |
| Rate Transition |
|
| Signal Conversion | Support code generation. |
| Signal Specification | |
| Weighted Sample Time | |
| Width |
Signal Routing
| Block | Support Notes |
|---|---|
| Bus Assignment | Support code generation. |
| Bus Creator | |
| Bus Selector | |
| Data Store Memory | |
| Data Store Read | |
| Data Store Write | |
| Demux | |
| Environment Controller | Not recommended for production code. Relates to resource limits and restrictions on speed and memory often found in embedded systems. Generated code can contain dynamic allocation and freeing of memory, recursion, additional memory overhead, and widely-varying execution times. While the code is functionally correct and generally acceptable in resource-rich environments, smaller embedded targets often cannot support such code. Usually, blocks evolve toward being suitable for production code. Thus, blocks suitable for production code remain suitable. |
| From | Support code generation. |
| Goto | |
| Goto Tag Visibility | |
| Index Vector | |
| Manual Switch | Not recommended for production code. Relates to resource limits and restrictions on speed and memory often found in embedded systems. Generated code can contain dynamic allocation and freeing of memory, recursion, additional memory overhead, and widely-varying execution times. While the code is functionally correct and generally acceptable in resource-rich environments, smaller embedded targets often cannot support such code. Usually, blocks evolve toward being suitable for production code. Thus, blocks suitable for production code remain suitable. |
| Merge | When multiple signals connected to a Merge block have a non-Auto storage class, all non-Auto signals connected to that block must be identically labeled and have the same storage class. When Merge blocks connect directly to one another, these rules apply to all signals connected to Merge blocks in the group. |
| Multiport Switch | Support code generation. |
| Mux | |
| Selector | |
| Switch | Generated code might rely on memcpy or memset (string.h). |
Sinks
| Block | Support Notes |
|---|---|
| Display | Ignored for code generation. |
| Floating Scope | |
| Outport (Out1) | Supports code generation. |
| Scope | Ignored for code generation. |
| Stop Simulation |
|
| Terminator | Supports code generation. |
| To File | Not recommended for production code. Relates to resource limits and restrictions on speed and memory often found in embedded systems. Generated code can contain dynamic allocation and freeing of memory, recursion, additional memory overhead, and widely-varying execution times. While the code is functionally correct and generally acceptable in resource-rich environments, smaller embedded targets often cannot support such code. Usually, blocks evolve toward being suitable for production code. Thus, blocks suitable for production code remain suitable. |
| To Workspace | Ignored for code generation. |
| XY Graph |
Sources
| Block | Support Notes |
|---|---|
| Band-Limited White Noise | Cannot use inside a triggered subsystem hierarchy. |
| Chirp Signal | Not recommended for production code. Relates to resource limits and restrictions on speed and memory often found in embedded systems. Generated code can contain dynamic allocation and freeing of memory, recursion, additional memory overhead, and widely-varying execution times. While the code is functionally correct and generally acceptable in resource-rich environments, smaller embedded targets often cannot support such code. Usually, blocks evolve toward being suitable for production code. Thus, blocks suitable for production code remain suitable. |
| Clock | |
| Constant | Supports code generation. |
| Counter Free-Running | Not recommended for production code. Relates to resource limits and restrictions on speed and memory often found in embedded systems. Generated code can contain dynamic allocation and freeing of memory, recursion, additional memory overhead, and widely-varying execution times. While the code is functionally correct and generally acceptable in resource-rich environments, smaller embedded targets often cannot support such code. Usually, blocks evolve toward being suitable for production code. Thus, blocks suitable for production code remain suitable. |
| Counter Limited |
|
| Digital Clock | Not recommended for production code. Relates to resource limits and restrictions on speed and memory often found in embedded systems. Generated code can contain dynamic allocation and freeing of memory, recursion, additional memory overhead, and widely-varying execution times. While the code is functionally correct and generally acceptable in resource-rich environments, smaller embedded targets often cannot support such code. Usually, blocks evolve toward being suitable for production code. Thus, blocks suitable for production code remain suitable. |
| Enumerated Constant | Supports code generation. |
| From File | Ignored for code generation. |
| From Workspace | |
| Ground | Support code generation. |
| Inport (In1) | |
| Pulse Generator | Cannot use inside a triggered subsystem hierarchy. Does not refer to absolute time when configured for sample-based operation. Depends on absolute time when in time-based operation. |
| Ramp | Not recommended for production code. Relates to resource limits and restrictions on speed and memory often found in embedded systems. Generated code can contain dynamic allocation and freeing of memory, recursion, additional memory overhead, and widely-varying execution times. While the code is functionally correct and generally acceptable in resource-rich environments, smaller embedded targets often cannot support such code. Usually, blocks evolve toward being suitable for production code. Thus, blocks suitable for production code remain suitable. |
| Random Number | Supports code generation. |
| Repeating Sequence |
|
| Repeating Sequence Interpolated |
|
| Repeating Sequence Stair | The Real-Time Workshop software does not explicitly group primitive blocks that constitute a nonatomic masked subsystem block in the generated code. This flexibility allows for more efficient code generation. In certain cases, you can achieve grouping by configuring the masked subsystem block to execute as an atomic unit by selecting the Treat as atomic unit option. |
| Signal Builder | Not recommended for production code. Relates to resource limits and restrictions on speed and memory often found in embedded systems. Generated code can contain dynamic allocation and freeing of memory, recursion, additional memory overhead, and widely-varying execution times. While the code is functionally correct and generally acceptable in resource-rich environments, smaller embedded targets often cannot support such code. Usually, blocks evolve toward being suitable for production code. Thus, blocks suitable for production code remain suitable. |
| Signal Generator | |
| Sine Wave |
|
| Step | Not recommended for production code. Relates to resource limits and restrictions on speed and memory often found in embedded systems. Generated code can contain dynamic allocation and freeing of memory, recursion, additional memory overhead, and widely-varying execution times. While the code is functionally correct and generally acceptable in resource-rich environments, smaller embedded targets often cannot support such code. Usually, blocks evolve toward being suitable for production code. Thus, blocks suitable for production code remain suitable. |
| Uniform Random Number | Supports code generation. |
User-Defined
| Block | Support Notes |
|---|---|
| Embedded MATLAB Function | Support code generation. |
| Fcn | |
| Level-2 M-File S-Function | Ignored during code generation. |
| MATLAB Fcn | Consider using the Embedded MATLAB Function block instead. |
| S-Function | S-functions that call into MATLAB are not supported for code generation. See User-Created Block Considerations for advice on generating optimized user-defined blocks. |
| S-Function Builder |
![]() | Block Support Considerations | Block Set Support for Code Generation | ![]() |

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