Main Content


Set deployment type of model

Since R2022a



setDeploymentType(coderMapObj, depType) sets the deployment type of the model specified by code mappings object coderMapObj to the type specified by depType. The deployment type controls the code interfaces at different levels of a model hierarchy. The code generator uses the deployment type to:

  • Enforce peer and nesting rules in the model hierarchy.

  • Map model elements to code interface definitions.

  • Generate code that uses the appropriate interface to connect to other parts of the hierarchy.


collapse all

The deployment type of a model controls the code interfaces at different levels of a model hierarchy.

To access the deployment type of a model, use the getDeploymentType function.

cm = coder.mapping.utils.create("CounterModel");
depType = getDeploymentType(cm)
depType =


The default deployment type of a model is Automatic.

To specify the deployment type of a model, use the setDeploymentType function.


Input Arguments

collapse all

Code mapping object (model code mappings), returned by a call to function coder.mapping.api.get.

The deployment type of the model, specified as Automatic, Component, or Subcomponent.

Deployment TypeDescription

Embedded Coder® determines the deployment type based on the model hierarchy context


The top model that generates code. The model generates a standalone algorithm. The component code exposes its interface to other components in the system.

Component deployment type is only valid for models with a service interface code configuration.


A model reference that a component model uses. The generated code entry points are symbolically scoped to the parent component.

Data Types: char

Version History

Introduced in R2022a