linkToModel

Link component to a model

Description

example

modelHandle = linktoModel(component,modelName) links from the component to a model.

modelHandle = linktoModel(component,modelFilePath) links from the component to a model.

Examples

collapse all

Save the component robotComp in the architecture model Robot.slx and reference it from another component, robotArm so that robotArm uses the architecture of robotComp.

saveAsModel(robotComp,'Robot');
linkToModel(robotArm,'Robot');

Input Arguments

collapse all

Architecture component with no children, specified as a systemcomposer.arch.Component object.

Model name for an existing model that defines the architecture or behavior of the component, specified as a character vector. Models of the same name prioritize protected models.

Example: 'Robot'

Data Types: char

Model file path for an existing model that defines the architecture or behavior of the component, specified as a character vector.

Example: 'Model.slx'

Example: 'ProtectedModel.slxp'

Data Types: char

Output Arguments

collapse all

Handle to the linked model, returned as a numeric value.

Data Types: double

Introduced in R2019a