Main Content

isComponent

Find if instance is component instance

Description

flag = isComponent(instance) finds whether the instance specified by instance is a component instance.

Note

This function is part of the instance programmatic interfaces that you can use to analyze the model iteratively, element-by-element. The instance refers to the element instance on which the iteration is being performed.

example

Examples

collapse all

Load the small unmanned aerial vehicle (UAV) model, create an architecture instance, and query whether the instance modified by the Components property is a component instance.

openProject("scExampleSmallUAV");
model = systemcomposer.loadModel("scExampleSmallUAVModel");
instance = instantiate(model.Architecture,"UAVComponent","NewInstance");
flag = isComponent(instance.Components(1))
flag = logical
   1

Input Arguments

collapse all

Output Arguments

collapse all

Whether instance is systemcomposer.analysis.ComponentInstance or systemcomposer.analysis.ArchitectureInstance, returned as 1 (true) or 0 (false).

Data Types: logical

More About

collapse all

Version History

Introduced in R2019a