convert/units - convert between units
|
Calling Sequence
|
|
convert(u, 'units', unitFrom, unitTo, opts)
convert(u*Unit(unitFrom), 'units', unitTo, opts)
|
|
Parameters
|
|
u
|
-
|
expression
|
unitFrom
|
-
|
symbol; unit to be converted from
|
unitTo
|
-
|
symbol; unit to be converted to
|
opts
|
-
|
(optional) equation(s) of the form option=value where option is one of energy or symbolic; specify options for the conversion
|
|
|
|
|
Description
|
|
•
|
The convert(u, 'units', unitFrom, unitTo) function multiplies the value u by the conversion factor from UnitFrom to UnitTo.
|
•
|
The units unitTo and unitFrom can be labeled in any way accepted by the Units package, for example, name, abbreviation, or symbol.
|
|
Note: Thermodynamic temperature conversions are for temperature intervals, not absolute temperatures. For example, 1 degree Celsius is converted to 1 kelvin, not 274.15 kelvin. For conversions of absolute temperatures, use convert/temperature.
|
•
|
You can modify the properties of the conversion by including options opts. The opts argument can contain one or more of the following equations.
|
|
If this option is set to true, the conversion can be between energy units, not necessarily units with the same dimensions. Furthermore, UnitTo can be set to to convert to a dimensionless quantity. For more information about energy transformations, see Energy Conversions.
|
|
This option specifies whether annotations to units should be ignored. By default, this option is set to false.
|
|
|
Examples
|
|
>
|
|
| (1) |
>
|
|
| (2) |
>
|
|
| (3) |
>
|
|
| (4) |
>
|
|
>
|
|
| (5) |
>
|
|
| (6) |
|
|