Main Content


Class: simscape.multibody.CompiledMultibody
Namespace: simscape.multibody

Visualize compiled multibody system in given state

Since R2022a


visualize(cmb,state,modelName) opens the Mechanics Explorer to display the 3-D graphical representation of the compiled multibody system, cmb, in the given state, state. If the Mechanics Explorer is already open, calling the visualize method adds a new tab to the visualization pane to display the compiled multibody system.

The Mechanics Explorer comprises a visualization pane, which displays the system, and a tree view pane that you can use to explore the system hierarchy. In the visualization pane, you can rotate, roll, pan, and zoom the model to more clearly view its components.

If the tab specified by modelName is already in use, the Mechanics Explorer replace the existing visualization with the new visualization.

If the given state has a status other than simscape.multibody.StateStatus.Valid, you can still use the visualize method to view the compiled multibody system, although some of the kinematic loops in the system may not be closed.

Input Arguments

expand all

Compiled multibody system, specified as a simscape.multibody.CompiledMultibody object.

State of the compiled multibody system, specified as a simscape.multibody.State object. The state object includes the position and velocity of every joint primitive in the compiled multibody system.

Name of the tabbed pane in which to display the compiled multibody system, specified as a string scalar or character vector. The name must be a valid MATLAB® identifier. You can use the isvarname function to check if the name is a valid identifier.

Example: 'Rocker_Down'



To learn about attributes of methods, see Method Attributes.

Version History

Introduced in R2022a