convert/units
convert between units
Calling Sequence
Parameters
Description
Examples
convert(expr, 'units', unitFrom, unitTo, opts)
convert(exprWithUnit, 'units', unitTo, opts)
expr
-
expression
unitFrom
symbol; unit to be converted from
unitTo
symbol; unit to be converted to
exprWithUnit
expression with unit
opts
(optional) equation(s) of the form option=value where option is one of energy or symbolic; specify options for the conversion
The convert(expr, 'units', unitFrom, unitTo) command 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.
For the second calling sequence, exprWithUnit can be any expression with a unit attached in any valid way. This can be, for example, 3*Unit('cm') or an expression with a unit added from the Units palette.
Notes:
To enter a unit in 2-D Math input, select the unit from the appropriate Units palette. If the unit you want is not there, select unit and then enter the unit.
When you edit a unit, double brackets appear around it.
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.
'energy'=true or false
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 1 to convert to a dimensionless quantity. For more information about energy transformations, see Energy Conversions.
'symbolic'=true or false
This option specifies whether annotations to units should be ignored. By default, this option is set to false.
convert⁡100.0,units,ft,m
30.48000000
convert⁡46145,units,yards,kilometers
10548747250000
convert⁡120,units,W,hp
200000000000000012428331193037837
convert⁡1,units,permittivityAtomic,1,energy=true
1
In the next two examples, the expression being converted has a unit associated with it. Here, only the unitTo parameter needs to provided.
convert⁡5⁢Unit⁡N⁢m⁡radius,units,N⁢m,symbolic=true
5⁢N⁢m
with⁡UnitsStandard:
3⁢Unit⁡kg⁢ms
3⁢kg⁢ms
convert⁡,units,lb⁢fth
4500000000000005760623099⁢lb⁢fth
See Also
convert
convert,conversion_table
convert/dimensions
convert/system
convert/temperature
convert/unit_free
electric permittivity
Energy Conversions
Units
Units/annotations
Units/Index
Download Help Document