Main Content


Specify rules for naming identifiers in generated code

Model Configuration Pane: Code Generation / Identifiers


Specify rules for naming identifiers in generated code.


This parameter:

  • Appears only for ERT-based targets.

  • Requires Embedded Coder® when generating code.

  • Is enabled by Signal naming.

  • Must be the same for top-level and referenced models.


'' (default) | string

Enter the name of a MATLAB® language file that contains the naming rule to be applied to signal, parameter, or #define parameter identifiers in generated code. Examples of rules you might program in such a MATLAB function include:

  • Remove underscore characters from signal names.

  • Add an underscore before uppercase characters in parameter names.

  • Make identifiers uppercase in generated code.

For example, the following function returns an identifier name by appending the text _signal to a signal data object name.

function revisedName = append_text(name, object)
% APPEND_TEXT: Returns an identifier for generated
% code by appending text to a data object name.
% Input arguments:
% name: data object name as spelled in model
% object: target data object
% Output arguments:
% revisedName: altered identifier returned for use in
% generated code.
text = '_signal';

revisedName = [name,text];


The MATLAB language file must be in the MATLAB path.

Recommended Settings

DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

Programmatic Use

Parameter: SignalNamingFcn
Type: character vector
Value: MATLAB language file
Default: ''

Version History

Introduced before R2006a