User`s guide

R2007b
16-4
Four New Angle-Unit Conversion Functions
The following functions have been added for efficient conversion of angle units (degrees
or radians) when either the target or destination units (but not both) are unknown before
run time.
toDegrees — Convert angles to degrees
toRadians — Convert angles to radians
fromDegrees — Convert angles from degrees
fromRadians — Convert angles from radians
If the output units match the inputs units, as in toDegrees(units, angle1,
angle2,...), where units turns out to equal 'degrees', then the input angles are
simply copied to the output angles.
Use these functions in place of angledim. The new functions are more efficient,
especially when the value of either the from or to argument of angledim is known in
advance and the value of the other angle-unit argument is not.
Improvements in Handling Length Units
Alternatives to the distdim Function
There are now more efficient ways to convert length and distance units than the
distdim function. In place of distdim, you can use unitsratio to compute multiplicative
factors to apply when converting between different units of distances and angles, which
you can use in subsequent calculations. For other alternatives, see Replacing distdim in
the distdim reference page for details.
The unitstr function Is Obsolete
The unitstr function, which validates names and abbreviations for units of distance,
angle, and time, is obsolete and will be removed in a future release. The syntax str =
unitstr(str,'times') has already been removed. Instead, see the documentation for
unitsratio for a list of valid unit strings.
Compatibility Considerations
There is no replacement for unitstr, but unitsratio recognizes all the unit strings
known to the toolbox.