| 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 |
| On this page… |
|---|
Specifies parameters for embeddable C code generation using Embedded MATLAB Coder.
To display the Real-Time Workshop dialog box for Embedded MATLAB Coder, follow these steps at the MATLAB command prompt:
Define a configuration object variable for embeddable C code generation in the MATLAB workspace by issuing a constructor command like this:
codegen_cfg=emlcoder.RTWConfig('system_target');Set system_target to:
Open the property dialog box using one of these methods:
Double-click the configuration object variable in the MATLAB workspace
Issue the open command from the MATLAB prompt, passing it the configuration object variable, as in this example:
open codegen_cfg;
The dialog box displays on your desktop.
Configuring Your Environment for Code Generation
Specifies general parameters for embeddable C code generation using Embedded MATLAB Coder.

The following table describes the general parameters for the Embedded MATLAB Coder Real-Time Workshop dialog box:
| General Parameter | Equivalent Command-Line Property and Values (default in bold) | Description |
|---|---|---|
| Compiler optimization level | RTWCompilerOptimization string, 'Off' , 'On', 'Custom' | Specify level of compiler optimization for generating code. Turning optimizations off shortens compile time; turning optimizations on minimizes run time. |
| Custom compiler optimization flags | RTWCustomCompilerOptimizations string, '' | Specify compiler optimization flags to apply to the generated code. |
| Generate makefile | GenerateMakefile true, false | Specify whether to generate a makefile during the build process. |
| Make command | MakeCommand string, 'make_rtw' | Specify a make command (if Generate makefile is selected). |
| Template makefile | TemplateMakeFile string, 'grt_default_tmf' | Specify a template makefile (if Generate makefile is selected). |
| Enable variable-sizing | EnableVariableSizing true, false | Enable support for variable-sized arrays. |
| Saturate on integer overflow | SaturateOnIntegerOverflow true, false | Add checks in the generated code to detect integer overflow or underflow. |
| Generated C-file partitioning method | FilePartitionMethod string, MapMFileToCFile, SingleFile | Specify whether to generate one C-file for each M-file or generate all C functions into a single file. |
Controls the report that is created for embeddable C code generation using Embedded MATLAB Coder.

The following table describes the report parameters for the Embedded MATLAB Coder Real-Time Workshop dialog box:
| Report Parameter | Equivalent Command-Line Property and Values (default in bold) | Description |
|---|---|---|
| Create code generation report | GenerateReport true, false | Document generated code in an HTML report. |
| Launch report automatically | LaunchReport true, false | Specify whether to automatically display HTML reports after code generation completes. |
Specifies parameters for selecting automatically generated naming rules for identifiers in embeddable C code generation using Embedded MATLAB Coder.
The Symbols tab appears as follows for GRT-based targets:

The Symbols tab appears as follows for ERT-based targets:

The following table describes the symbols parameters for the Embedded MATLAB Coder Real-Time Workshop dialog box:
| Symbols Parameter | Equivalent Command-Line Property and Values (default in bold) | Description |
|---|---|---|
| Global variables | CustomSymbolStrGlobalVar string, '$M$N' For more details, see Settings | Customize generated global variable identifiers. Dependencies:
|
| Global types | CustomSymbolStrType string, '$M$N' For more details, see Settings | Customize generated global type identifiers. Dependencies:
|
| Local functions | CustomSymbolStrFcn string, 'm_$M$N' For more details, see Settings | Customize generated local function identifiers. Dependencies:
|
| Local temporary variables | CustomSymbolStrTmpVar string, 'eml_$M$N' For more details, see Settings | Customize generated local temporary variable identifiers. Dependencies:
|
| Constant macros | CustomSymbolStrMacro string, '$M$N' For more details, see Settings | Customize generated constant macro identifiers. Dependencies:
|
| Maximum identifier length | MaxIdLength integer, 31 | Specify maximum number of characters in generated function, type definition, and variable names. Minimum is 31. |
| Reserved names | ReservedNameArray string, '' | Enter the names of variables or functions in the generated code that match the names of variables or functions specified in custom code. |
Settings. Enter a macro string that specifies whether, and in what order, certain substrings are to be included in the generated identifier. The macro string can include valid C-identifier characters and a combination of the following format tokens:
| Token | Description |
|---|---|
| $M | Insert name mangling string to avoid naming collisions. Required. |
| $N | Insert name of parameter (global variable, global type, local function, local temporary variable or constant macro) for which identifier is being generated. Recommended to ensure readability of generated code. |
| $R | Insert root project name into identifier, replacing any unsupported characters with the underscore (_) character. |
Creates a list of custom C code, directories, source and header files, and libraries to be included in files generated by Embedded MATLAB Coder.

Select the type of information to include from the list on the left side of the pane.
Enter a string to identify the specific code, directory, source file, or library.
Click Apply.
The following table describes the custom code parameters for the Embedded MATLAB Coder Real-Time Workshop dialog box:
| Custom Code Parameter | Equivalent Command-Line Property and Values (default in bold) | Description |
|---|---|---|
| Source file | CustomSourceCode string, '' | Specify code appearing near the top of the generated .c or .cpp file, outside of any function. |
| Header file | CustomHeaderCode string, '' | Specify code appearing near the top of the generated .h file. |
| Initialize function | CustomInitializer string, '' | Specify code appearing in the initialize function of the generated .c or .cpp file. |
| Terminate function | CustomTerminator string, '' | Specify code appearing in the terminate function of the generated .c or .cpp file. |
| Include directories | CustomInclude string, '' | Specify a space-separated list of include directories to add to the include path when compiling the generated code. |
| Source files | CustomSource string, '' | Specify a space-separated list of source files to compile and link with the generated code. |
| Libraries | CustomLibrary string, '' | Specify a space-separated list of static library files to link with the generated code. |
Specifies parameters for debugging the Embedded MATLAB Coder build process.

The following table describes the debug parameters for the Embedded MATLAB Coder Real-Time Workshop dialog box:
| Debug Parameter | Equivalent Command-Line Property and Values (default in bold) | Description |
|---|---|---|
| Verbose build | RTWVerbose true, false | Display code generation progress. |
Specifies parameters for selecting the target software environment for the code generated by Embedded MATLAB Coder.
The Interface tab appears as follows for GRT-based targets:

The Interface tab appears as follows for ERT-based targets:

The following table describes the interface parameters for the Embedded MATLAB Coder Real-Time Workshop dialog box:
| Interface Parameter | Equivalent Command-Line Property and Values (default in bold) | Description |
|---|---|---|
| Target function library | TargetFunctionLibrary string, 'ANSI_C' | Specify a target-specific math library for your model. Supports target function libraries (TFLs) for GRT system target files. If you have a Real-Time Workshop Embedded Coder license, you can configure Embedded MATLAB Coder to use ERT TFLs when generating C code. You enable this feature by defining a configuration object for C code generation using an ert parameter at the MATLAB command prompt, as in this example: rtwcfg = emlcoder.RTWConfig('ert') |
| Support: floating-point numbers | PurelyIntegerCode string, 'on' | Specify whether to generate floating-point data and operations. Dependencies:
|
| Support: non-finite numbers | SupportNonFinite string, 'on' | Specify whether to generate nonfinite data and operations. Dependencies:
|
Specifies parameters for fine-tuning the behavior of the compiler.

The following table describes the advanced parameters for the Embedded MATLAB Coder Real-Time Workshop dialog box:
| Advanced Parameter | Equivalent Command-Line Property and Values (default in bold) | Description |
|---|---|---|
| Inline Threshold | InlineThreshold integer, 10 | Specify the maximum size of functions to be inlined. |
| Inline Threshold Max | InlineThresholdMax integer, 200 | Specify the maximum size of functions after inlining. |
| Inline Stack Limit | InlineStackLimit integer, 4000 | Specify the stack size limit on inlined functions. |
| Stack Usage Max | StackUsageMax integer, 200000 | Specify the maximum stack usage per function. |
| Constant Folding Timeout | ConstantFoldingTimeout integer, 10000 | Specify the maximum number of instructions to be executed by the constant folder. |
Specify code generation versus an executable build. See Generate code only.
![]() | Configuration Parameters for Embedded MATLAB Coder | Automatic C MEX Generation Dialog Box for Embedded MATLAB Coder | ![]() |

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 |