createModel
Create AUTOSAR architecture model for composition or Simulink behavior model for component
Syntax
Description
createModel(
creates Simulink® behavior model component,modelName)modelName and links the
Component block to the behavior model. By default, the behavior of the
model is based on the interface of the specified AUTOSAR component. The
component argument is a component handle returned by a previous call
to addComponent. If not specified, modelName
defaults to the name of the AUTOSAR component.
createModel(
creates Simulink behavior model component,modelName,BehaviorType=behavior) modelName with the modeling style
specified by behavior and links the Component block to
the behavior model. The component argument is a component handle
returned by a previous call to addComponent. If not specified,
modelName defaults to the name of the component.
createModel(
creates an AUTOSAR architecture model composition,modelName)modelName with the same interface
as the specified AUTOSAR composition. The composition argument is a
composition handle returned by a previous call to addComposition. If
not specified, modelName defaults to the name of the AUTOSAR component
or composition.
Examples
Input Arguments
Tips
You can extract compositions from architecture models, and components from compositions programmatically.
For example, for example model
autosar_tpc_compositionyou can extract the composition from the architecture model by running these commands in the MATLAB® Command Window.openExample("autosar_tpc_composition"); archModel = autosar.arch.loadModel("autosar_tpc_composition.slx"); sensorComposition = archModel.Compositions(1)
sensorComposition = Composition with properties: Name: 'Sensors' SimulinkHandle: 238.0005 Parent: [1×1 autosar.arch.Model] Components: [4×1 autosar.arch.Component] Compositions: [0×0 autosar.arch.Composition] Ports: [5×1 autosar.arch.CompPort] Connectors: [7×1 autosar.arch.Connector] Adapters: [0×0 autosar.arch.Adapter]You can also extract a component from a composition by running this command in the MATLAB Command Window.
component = sensorComposition.Components(1)
component = Component with properties: Name: 'Monitor' SimulinkHandle: 819.0001 Parent: [1×1 autosar.arch.Model] Kind: 'Application' Ports: [3×1 autosar.arch.CompPort] ReferenceName: 'autosar_tpc_throttle_sensor_monitor'
Version History
Introduced in R2020a
See Also
linkToModel | addComponent | addComposition | importFromARXML