User`s guide

16-3
retained in Version 2.6 for backward compatibility. The functions degtorad, radtodeg,
and unitsratio provide additional alternatives.
Because it must resolve both the input and output units, angledim is excessive for most
applications. It works only for class double and it quietly discards the imaginary part of
any complex input. You can use any of several more efficient alternatives:
If you are working from the command line, you can often replace angledim with
degtorad or radtodeg. If you are converting angle units within a script or function
and you know both the from and to unit names at the time of coding, then you can
also replace angledim with degtorad or radtodeg. If you know either from or to
at the time of coding, then you can use fromRadians, fromDegrees, toRadians, or
toDegrees. Apply one of the following transformations to your code:
angledim(angleIn,'radians',to)
fromRadians(to,angleIin)
angledim(angleIn,'degrees',to)
fromDegrees(to,angleIin)
angledim(angleIn,from,'radians')
toRadians(from,angleIn)
angledim(angleIn,from,'degrees')
toDegrees(from,angleIn)
Also note that the functions in the fromRadians family can convert multiple variables in
a single function call. For example, you can replace this code
angle1 = angledim(angle1InRadians,'radians',to);
angle2 = angledim(angle2InRadians,'radians',to);
with
[angle1,angle2] = fromRadians(to,angle1InRadians,angle2InRadians);
If you do not know either from or to at the time of coding, then you can call unitsratio
to obtain the correct conversion factor, then multiply the values of one or more variables.
For example, you can replace:
angle1Out = angledim(angle1In, from, to);
angle2Out = angledim(angle2In, from, to);
with
r = unitsratio(to, from);
angle1Out = r * angle1In;
angle2Out = r * angle2In;