Main Content


Change physical unit of kinematic variable


setVariableUnit(ks,ids,unit) changes the physical unit of the kinematic variable id in the KinematicsSolver object ks to the measure given in unit. That measure must be a valid unit, and the unit must be appropriate for the variable—a length for translation variables and an angle for rotation variables. Rotation axis components, used in spherical joint primitives, must remain unitless.

The new unit applies to every instance of the specified variable: if the variable appears in several variable groups, the unit takes effect in each of the groups.

Input Arguments

collapse all

Kinematics solver object, specified as a KinematicsSolver object that is the representation of the Simscape™ Multibody™ model used for kinematic analysis.

Example: ks = simscape.multibody.KinematicsSolver("DoublePendulumExample​'​')

Identifiers of the kinematic variables, specified as either a cell array of characters or string vector. The cell array of character and string vector can be 1-by-N or N-by-1, where N is a positive integer. Use the jointPositionVariables or jointVelocityVariables object function to show the IDs for joint variables. Use the frameVariables object function to show the IDs for frame variables.

Example: "j1.Rz.q", ["j1.Rz.q", "j2.Rz.q"], {'j1.Rz.q'}, or {'j1.Rz.q'; 'j2.Rz.q'};

New unit for the variable id of the object ks. The unit must be valid and appropriate for the type of variable. Translational variables must be in units of length and rotational variables must be in units of angle.

Example: 'ft'

Data Types: char | string

Version History

Introduced in R2019a