Unit Conversion Toolbox Overview

The unit conversion toolbox connects a simple Matlab variable with a name of a unit, such as feet or mph. When the unit has been attached, variables can be used in much the same way as any Matlab variable. Variables can represent a scalar, a vector, or an array. Variables can be operated on by standard mathematical operators like add, subtract, multiply, or divide. Other functions which accept units are also available. These include including exponentiation, trigonometric, hyperbolic functions.

Variables can be converted to another unit type, such as feet to yards or miles-per-hour to feet-per-second. Units that are not directly available in the conversion table (which is extensive) can be constructed from available units, such as 'feet/second'.

Plotting routines that accept variables with units are also available. These routines differ slightly from the standard routines in that the default axis labels are created from the names of the X and Y variables being plotted. The units for these variables are shown in the default axis labels as well. For multiple values of Y, each vector must be placed in a structure. The field names of the structure are then used to create a legend for the plot. Defaults labels can be altered with the standard xlabel and ylabel commands.