Open code generation example models from the documentation or command line
The example models included in Simulink®
Coder™ and Embedded Coder® show you how to generate code for different use cases and meet different code
generation goals. Use openExample
to
open example models from the command line. For example, to open the
CodeBuildModel
model,
enter:
openExample('CodeBuildModel')
Before R2022b, the code generation example models were named
rtwdemo_<model>
and were available on the MATLAB® path. From R2022b to R2023b, the example models were removed from the path and
renamed according to these tables. To find models and open examples, you can use this list or
use the functions modelfinder
and
openExample
.
Models Renamed in R2022b
These models are available with Simulink Coder and were renamed in R2022b.
R2022a model name | R2022b and later model name | Example |
---|---|---|
rtwdemo_col_dlut3d_selplane | ColumnDLUT3DSelectPlane | Direct Lookup Table Algorithm for Row-Major Array Layout |
rtwdemo_col_dlut3d_selvector | ColumnDLUT3DSelectVector | |
rtwdemo_row_dlut3d_selplane | RowDLUT3DSelectPlane | |
rtwdemo_row_dlut3d_selvector | RowDLUT3DSelectVector | |
rtwdemo_condinput | ConditionalInput | Use Conditional Input Branch Execution |
rtwdemo_deadpathElim | DeadPathElimination | Eliminate Dead Code Paths in Generated Code |
rtwdemo_foreachreuse | ForEachReuse | Generate Reusable Code from For Each Subsystems |
rtwdemo_row_interpalg | RowInterpolationAlgorithm | Interpolation Algorithm for Row-Major Array Layout |
rtwdemo_row_lut2d | RowLUT2D | |
rtwdemo_mdlreftop | TopModelCode | File Packaging for Models (Code and Data) |
rtwdemo_mdlrefbot | ReferenceModelCode |
These models are available with Embedded Coder and were renamed in R2022b.
R2022a model name | R2022b and later model name | Example |
---|---|---|
rtwdemo_concurrent_execution | MulticoreConcurrentTasking | Model Multicore Concurrent Tasking Application |
rtwdemo_cppclass | CppClassRateBased | Configure C++ Class Interface for Rate-Based Models |
rtwdemo_cppclass_expfcn | CppClassExportFunction | Configure C++ Class Interface for Export-Function Models |
rtwdemo_cppclass_workflow | CppClassWorkflowKeyIgnition | Generate C++ Code from Simulink Models |
rtwdemo_explicitinvocation_atomicsubsys | AtomicSubsystem | Generate Code for Atomic Subsystems |
rtwdemo_multirate_multitasking | MultirateMultitasking | Model Single-Core, Rate-Monotonic Multitasking Application |
rtwdemo_multirate_singletasking | MultirateSingleTasking | Model Single-Core, Single-Tasking Application |
rtwdemo_sil_block | SILBlock | Test Generated Code with SIL and PIL Simulations |
rtwdemo_sil_modelblock | SILModelBlock | |
rtwdemo_sil_counter | SILCounter | |
rtwdemo_sil_topmodel | SILTopModel | |
rtwdemo_udt | UserDefinedDataTypes | Define Abstract Numeric Types and Rename Types |
Models Renamed in R2023a
These models are available with Simulink Coder and were renamed in R2023a.
These models are available with Embedded Coder and were renamed in R2023a.
Models Renamed in R2023b
These models are available with Simulink Coder and were renamed in R2023b.
R2023a model name | R2023b and later model name | Example |
---|---|---|
rtwdemo_atomic | SubsystemAtomic | Generate Subsystem Code as Separate Function and Files |
rtwdemo_codebuild | CodeBuildModel | Compile Code in Another Development Environment |
rtwdemo_codebuild_ref | CodeBuildRefModel | |
rtwdemo_comments | CustomCodeComments | Get Code Description of Generated Code |
rtwdemo_configrpinterface | ConfigurationRapidPrototypingInterface | Access Signal, State, and Parameter Data During Execution |
rtwdemo_counter | CounterModel | Register Custom Toolchain and Build Executable |
rtwdemo_dynamicio | DynamicIO | Share Data Between Code Generated from Simulink, Stateflow, and MATLAB |
rtwdemo_fixpt1 | FixedPointCodeGeneration | Optimize Generated Code Using Fixed-Point Data with Simulink, Stateflow, and MATLAB |
rtwdemo_irtshared | StartupResetShutdownShared | Startup, Reset, and Shutdown Function Interfaces |
rtwdemo_memset | MemsetOptimization | Optimize Generated Code Using memset Function |
rtwdemo_mrmtbb | MultirateMultitaskingBareBoard | Analyze Generated Data Code Interface Report |
rtwdemo_mrstbb | MultirateSingletaskingBareBoard | Time-Based Scheduling Example Models |
rtwdemo_parabuild_a_1 | ParallelBuildA1 | Reduce Build Time for Referenced Models by Using Parallel Builds |
rtwdemo_parabuild_b_1 | ParallelBuildB1 | |
rtwdemo_parabuild_b_2 | ParallelBuildB2 | |
rtwdemo_parabuild_b_3 | ParallelBuildB3 | |
rtwdemo_paraminline | InlineBlockParameters | Inline Numeric Values of Block Parameters |
rtwdemo_ratetrans | MultirateMultitaskingRateTransitions | Separate Rate Transition Block Code and Data from Algorithm Code and Data |
rtwdemo_sfcn_rls | SFunctionForCodeReuse | S-Functions for Code Reuse |
rtwdemo_sfcn_rls_lib | SFunctionForCodeReuseLibrary | |
rtwdemo_srbb | SingleRateBareBoard | Single-Rate Modeling (Bare Board, No OS) |
rtwdemo_ssreuse | GeneratedCodeFunctionReuse | Function Reuse in Generated Code |
rtwdemo_targetsettings | TargetSettings | Configure Run-Time Environment Options |
rtwdemo_throttlecntrl | ThrottleControl | Configure Model, Generate Code, and Simulate |
rtwdemo_throttlecntrl_testharness | ThrottleControlTestHarness | |
rtwdemo_throttlecntrl_datainterface | ThrottleControlDataInterface | Configure Data Interface |
rtwdemo_throttlecntrl_extfunccall | ThrottleControlExtFuncCall | Call External C Functions |
rtwdemo_underspecified_datatype | UnderspecifiedDataType | Use single Data Type as Default for Underspecified Types |
These models are available with Embedded Coder and were renamed in R2023b.