Units
Split
split an expression into a unitless part and a unit
Calling Sequence
Parameters
Description
Examples
Compatibility
Split(expr)
Split(expr, output = o)
expr
-
algebraic expression, typically with units
o
the names unit or coefficient, or a list of these names
The Split command splits an expression into a unitless part and a unit.
By default, the command returns both the unitless part and the unit as an expression sequence: first the unitless part, then the unit.
You can use the output option to make Split return only one of the two. If you specify output=unit, only the unit is returned. If you specify output=coefficient, only the unitless part is returned. If you specify output=l, where l is a list of the names unit and coefficient, then Split returns the corresponding values as an expression sequence in the order specified. The default value of the output option is coefficient,unit.
If expr is itself unitless, the unit is 1. If expr is just a unit (that is, a call to the Unit function), the unitless part is 1.
with⁡Units:
Automatically loading the Units[Simple] subpackage
expr≔5⁢Unit⁡m
expr≔5⁢m
Split⁡expr
5,m
Split⁡Unit⁡barrelbeer
1,bblbeer
Split⁡17
17,1
distance≔17⁢Unit⁡m
distance≔17⁢m
speed≔5⁢Unit⁡kmh
speed≔5⁢kmh
duration≔distancespeed
duration≔175000⁢h
Split⁡duration
175000,h
Split⁡duration,output=coefficient
175000
Split⁡duration,output=unit,coefficient
h,175000
The Units[Split] command was introduced in Maple 2021.
For more information on Maple 2021 changes, see Updates in Maple 2021.
See Also
combine,units
convert,unit_free
Download Help Document