Main Content


Base units of unit system



baseUnits(unitSystem) returns the base units of the unit system unitSystem as a vector of symbolic units. You can use the returned units to create new unit systems by using newUnitSystem.


collapse all

Get the base units of a unit system by using baseUnits. Then, modify the base units and create a new unit system using the modified base units. Available unit systems include SI, CGS, and US. For all unit systems, see Unit Systems List.

Get the base units of the SI unit system.

SIUnits = baseUnits('SI')
SIUnits =
[ [kg], [s], [m], [A], [cd], [mol], [K]]


Do not define a variable called baseUnits because the variable will prevent access to the baseUnits function.

Define base units that use kilometer for length and hour for time by modifying SIUnits using subs.

u = symunit;
newUnits = subs(SIUnits,[u.m u.s],[])
newUnits =
[ [kg], [h], [km], [A], [cd], [mol], [K]]

Define the new unit system by using newUnitSystem.

ans = 

To convert units between unit systems, see Unit Conversions and Unit Systems.

Input Arguments

collapse all

Name of the unit system, specified as a string or character vector.

Version History

Introduced in R2017b