Main Content

connect

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

Link two connectors in Multibody object

Description

connect(mb,connector1,connector2) links two connectors, connector1 and connector2, of the components at the top level of the simscape.multibody.Multibody object, mb.

The connect method makes connections only for objects at the top level of a Multibody object. You cannot link two connectors from the same object.

In general, connections are made between two connectors. However, in some cases, it is necessary to connect three or more connectors together. The figure shows an example of a three-way connection.

3-way connection illustration

The Elbow, LowerArm, and MotorMass objects represent three parts of a Multibody object, Robot. To connect these objects together, first you connect the Elbow and LowerArm objects:

connect(Robot, "Elbow/F", "LowerArm/in");

Then, connect the MotorMass object to Elbow object:

connect(Robot, "MotorMass/R", "Elbow/F");

Alternatively, you can connect the MotorMass object to LowerArm object:

connect(Robot, "MotorMass/R", "LowerArm/in");

The two options are equivalent. If you need to add a fourth connector to the three-way connection, you can connect the fourth connector to any of the three linked connectors, F, in, or R.

Input Arguments

expand all

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

Path of the first connector, specified as a string scalar or character vector. The path has two elements separated by a forward slash. The first element is the name of the object, and the second element is the connector name.

Example: "Motor_Mass/R"

Path of the second connector, specified as a string scalar or character vector. The path has two elements separated by a forward slash. The first element is the name of the object, and the second element is the connector name.

Example: "Elblow_Joint/F"

Attributes

Accesspublic

To learn about attributes of methods, see Method Attributes.

Version History

Introduced in R2022a