Main Content

setVariableUnit

Change physical unit of kinematic variable

Description

setVariableUnit(ks,id,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

A KinematicsSolver object is the representation of a Simscape Multibody model used for kinematic analysis.

Example: ks = simscape.multibody.KinematicsSolver('sm_double_pendulum')

Data Types: KinematicsSolver object

Identifier for the kinematic variable whose units to change. Enter the identifier as shown in the ID column of the jointPositionVariables or jointVelocityVariables table, for joint variables, or frameVariables table for frame variables.

Example: 'j1.Rz.q'

Data Types: char | string

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

Introduced in R2019a