Main Content


(Removed) Add component to view given path

The addComponent function has been removed. You can create a view using the createView function and then add a component using the addElement function. For further details, see Compatibility Considerations.



viewComp = addComponent(object,compPath) adds the component with the specified path.

addComponent is a method for the class systemcomposer.view.ViewArchitecture.


collapse all

Create a model, extract its architecture, and add three components.

model = systemcomposer.createModel('mobileRobotAPI');
arch = model.Architecture;
components = addComponent(arch,{'Sensor','Planning','Motion'});

Create a view architecture, a view component, and add a component. Open the architecture views editor to see it.

view = model.createViewArchitecture('NewView');
viewComp = fobSupplierView.createViewComponent('ViewComp');

Input Arguments

collapse all

View architecture, specified as a systemcomposer.view.ViewArchitecture object.

Path to the component including the name of the top-model, specified as a character vector.

Example: 'mobileRobotAPI/Motion'

Data Types: char

Output Arguments

collapse all

View component, returned as a systemcomposer.view.ViewComponent object.

Compatibility Considerations

expand all

Errors starting in R2021a

Introduced in R2019b