Main Content

createArchitectureModel

Create architecture model from component

Since R2021b

Description

createArchitectureModel(component,modelName) creates an architecture model from the component component that references the model modelName.

Note

Components with physical ports cannot be saved as architecture models, model references, software architectures, or Stateflow® chart behaviors. Components with physical ports can only be saved as subsystem references or as subsystem component behaviors.

example

createArchitectureModel(component,modelName,modelType) creates an architecture model of type modelType from the component component that references the model modelName.

example

Examples

collapse all

Save the component robotComp in the Robot.slx model and reference the model.

Create a model named archModel.slx.

model = systemcomposer.createModel("archModel");
systemcomposer.openModel("archModel");
arch = get(model,"Architecture");

Add two components to the model electricComp and robotComp. Rearrange the model.

names = ["electricComp","robotComp"];
comp = addComponent(arch,names);
Simulink.BlockDiagram.arrangeSystem("archModel")

Save the robotComp component as an architecture model so the component references the model Robot.slx.

createArchitectureModel(comp(2),"Robot");

Save the component electricComp in the RobotSoftware.slx model and reference the model.

Create a model named archModel.slx.

model = systemcomposer.createModel("archModel");
systemcomposer.openModel("archModel");
arch = get(model,"Architecture");

Add two components to the model electricComp and robotComp. Rearrange the model.

names = ["electricComp","robotComp"];
comp = addComponent(arch,names);
Simulink.BlockDiagram.arrangeSystem("archModel")

Save the electricComp component as a software architecture model so the component references the model RobotSoftware.slx.

createArchitectureModel(comp(1),"RobotSoftware","SoftwareArchitecture");

Save the component throttlePositionControl in the autosarTpcSys.slx model and reference the model.

Create a model named archModel.slx.

model = systemcomposer.createModel("archModel");
systemcomposer.openModel("archModel");
arch = get(model,"Architecture");

Add two components named throttlePositionControl and Sensor to the model. Rearrange the model.

names = ["throttlePositionControl","Sensor"];
comp = addComponent(arch,names);
Simulink.BlockDiagram.arrangeSystem("archModel")

Save the throttlePositionControl component as a software architecture model so the component references the model autosarTpcSys.slx.

createArchitectureModel(comp(1),"autosarTpcSys","ClassicAUTOSARArchitecture");

Input Arguments

collapse all

Component, specified as a systemcomposer.arch.Component object. The component must have an architecture with definition type composition. For other definition types, this function gives an error.

Name of model, specified as a character vector or string.

Example: "exMobileRobot"

Data Types: char | string

Type of model, specified as one of these values:

  • "Architecture" – An architecture model

  • "SoftwareArchitecture" – A software architecture model

  • "ClassicAUTOSARArchitecture" – A Classic AUTOSAR architecture model

  • "AdaptiveAUTOSARArchitecture" – An Adaptive AUTOSAR architecture model

Data Types: char | string

More About

collapse all

Version History

Introduced in R2021b