Products & Services Solutions Academia Support User Community Company

Learn more about Simulink   

Simulation Target Pane: Custom Code

Simulation Target: Custom Code Tab Overview

Include custom code settings for a model that contains Embedded MATLAB Function blocks, Stateflow charts, or Truth Table blocks.

Configuration

  1. Select the type of information to include from the list on the left side of the pane.

  2. Enter a string to identify the specific code, directory, source file, or library.

  3. Click Apply.

See Also

Source file

Enter code lines to appear near the top of a generated source code file.

Settings

Default: ' '

Code lines appear near the top of the generated model.c source file, outside of any function.

Command-Line Information

Parameter: SimCustomSourceCode
Type: string
Value: any source file name
Default: ''

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

See Also

Header file

Enter code lines to appear near the top of a generated header file.

Settings

Default: ' '

Code lines appear near the top of the generated model.h header file.

Tips

Command-Line Information

Parameter: SimCustomHeaderCode
Type: string
Value: any header file name
Default: ''

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

See Also

Initialize function

Enter code statements that execute once at the start of simulation.

Settings

Default: ' '

Code appears inside the model's initialize function in the model.c file.

Tip

Command-Line Information

Parameter: SimCustomInitializer
Type: string
Value: any code
Default: ''

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

See Also

Terminate function

Enter code statements that execute at the end of simulation.

Settings

Default: ' '

Code appears inside the model's terminate function in the model.c file.

Tip

Command-Line Information

Parameter: SimCustomTerminator
Type: string
Value: any code
Default: ''

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

See Also

Include directories

Specify a list of directory paths that contain files you include in the compiled target.

Settings

Default:''

Enter a space-separated list of directory paths.

Command-Line Information

Parameter: SimUserIncludeDirs
Type: string
Value: any directory file name
Default: ''

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

See Also

Source files

Specify a list of source files to compile and link into the target.

Settings

Default:''

You can separate source files with a comma, a space, or a new line.

Tip

Command-Line Information

Parameter: SimUserSources
Type: string
Value: any source file name
Default: ''

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

See Also

Libraries

Specify a list of static libraries that contain custom object code to link into the target.

Settings

Default:''

Enter a space-separated list of library files.

Tip

Command-Line Information

Parameter: SimUserLibraries
Type: string
Value: any library file name
Default: ''

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

See Also

Use local custom code settings (do not inherit from main model)

Specify if a library model can use custom code settings that are unique from the main model.

Settings

Default: Off

On

Enables a library model to use custom code settings that are unique from the main model.

Off

Disables a library model from using custom code settings that are unique from the main model.

Dependency

This parameter is available only for library models that contain Embedded MATLAB Function blocks, Stateflow charts, or Truth Table blocks. To access this parameter, select Tools > Open Simulation Target in the Embedded MATLAB Editor or Stateflow Editor for your library model.

Command-Line Information

Parameter: SimUseLocalCustomCode
Type: string
Value: 'on' | 'off'
Default: 'off'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

See Also

  


Related Products & Applications

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