This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Information on units of measurement


A = unitInfo(___)



unitInfo(unit) returns information for the symbolic unit unit.


unitInfo(dim) returns available units for the dimension dim.


unitInfo returns a list of available physical dimensions.


A = unitInfo(___) returns the output in A using any of the input arguments in the previous syntaxes. Dimensions are returned as strings, and units are returned as symbolic units.


collapse all

Find information on unit u.Wb where u = symunit. The unitInfo function specifies that Wb is the SI unit of magnetic flux.

u = symunit;
weber - a physical unit of magnetic flux. ['SI']

Get all units for measuring 'MagneticFlux' by calling unitInfo('MagneticFlux').
SI units accept all SI prefixes. For details, see SI Unit Prefixes List.

Find all available units for 'MagneticFlux' as described.

All units of dimension 'MagneticFlux':

abWb - abweber
Mx - maxwell
statWb - statweber
Wb - weber ['SI']

Get the base SI units of any unit above by calling rewrite(<unit>,'SI').
SI units accept all SI prefixes. For details, see SI Unit Prefixes List.

unitInfo also returns information on compound units. Find information on u.m/u.s^2.

meter per square second - a physical unit of acceleration. ['SI']

Get all units for measuring 'Acceleration' by calling unitInfo('Acceleration').
SI units accept all SI prefixes. For details, see SI Unit Prefixes List.

Return all available dimensions using unitInfo without input arguments.


Store information returned by unitInfo for use by providing an output.

Store the dimension of u.C.

u = symunit;
dimC = unitInfo(u.C)
dimC = 

Find and store all units for the dimension dimC.

unitsEC = unitInfo(dimC)
unitsEC =

Find information on the third unit of unitsEC.

elementary charge - a physical unit of electric charge.

Get all units for measuring 'ElectricCharge' by calling unitInfo('ElectricCharge').

Store [e]. Then, approximate the electrons in a coulomb of electric charge.

electronCharge = unitsEC(3);
numElectrons = simplify(u.C/electronCharge)
numElectrons =

Show that approximately 6.24 x 1018 electrons are in a coulomb by converting the high-precision symbolic result to double.

numElectrons = double(numElectrons)
numElectrons =

Input Arguments

collapse all

Unit name, specified as a symbolic unit, character vector, or string.

Example: unitInfo(u.m) where u = symunit

Dimension, specified as a character vector or string.

Example: unitInfo('Length')

Introduced in R2017b