ecl-logo Documentation

Unitless

Unitless[expr]unitlessExpr

removes any Units from an expr to return only the numeric value.

Unitless[expr,targetUnit]unitlessExpr

removes the Units from an expr after first converting it to the targetUnit Units.

Details

    Input
    Output

Examples

Basic Examples  (3)

The function is used to strip Units off of items and return only their numeric values:

A conversion unit can be provided such that the item si converted before returning a numeric value:

String units off a QuantityArray:

Additional Examples  (10)

If Unitless is provided with items that are already numeric, they are left untouched:

Remove all Units from expression:

Strip the untis off of a quantity distribution:

Convert and then strip the untis off of a quantity distribution:

Strip the units off of a multi-variate quantity distribution:

Convert and then strip the units off of a multi-variate quantity distribution:

Strip the units off of a data distribution:

Convert and then strip the units off of a data distribution:

Given QuantityFunction, return its pure function:

Given QuantityFunction and conversion:

Attributes  (3)

Listable  (3)

The function can strip the Units from a list of items as well:

A common conversion unit can be provided to a list of items to make Unitless:

A paired list of Units can also be converted in this way:

Possible Issues  (5)

Incompatible  (1)

If the conversion is not recognized as CompatibleUnitQ, then Unitless will throw an error:

Physical Constants  (4)

Physical constants are represented behind the scences as 1*PhysicalConstant, where PhysicalConstant is the unit:

Asking for their numeric value will return 1:

They can be converted to any compatible unit:

To get a physical constant's numeric value in some other unit, you must first convert to the desired units: