Main Content


Class: simscape.multibody.Multibody
Package: simscape.multibody

Extract component object from Multibody object


C = component(mb,path) extracts a component object, C, from the simscape.multibody.Multibody object, mb. The path argument is the path of the component object in the mb object and can have more than one elements. In other words, the component method can extract an object from any hierarchical level of the mb object.

The extracted object is a copy of the original component object. Therefore, any subsequent changes to the extracted copy do not affect the original component object.

Input Arguments

expand all

Multibody system, specified as a simscape.multibody.Multibody object.

Path of the component object, specified as a string scalar or character vector. The length of the path depends on the hierarchical level of the component object in the Multibody object. If the object is at the top level, the path has one element. If the component object is in an inner object that is at the top level hierarchy, the path has two elements separated by a forward slash. The first element is the name of the inner object, and the second element is the name of desired component object.

Example: "Suspension/Front_Left/Shock/Prismatic_Joint"

Output Arguments

expand all

Copy of the component object, returned as an object of a subclass of simscape.multibody.Component abstract class. Modifying the extracted component object does not affect the original component object.



To learn about attributes of methods, see Method Attributes.

Version History

Introduced in R2022a