Main Content

unitInfo

Information on units of measurement

Description

example

unitInfo(unit)returns information for the symbolic unitunit.

example

unitInfo(dim)returns available units for the dimensiondim.

example

unitInforeturns a list of available physical dimensions.

example

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

Examples

collapse all

Find information on unitu.Wbwhereu = symunit. TheunitInfofunction specifies thatWbis the SI unit of magnetic flux.

u = symunit; unitInfo(u.Wb)
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.

unitInfo('MagneticFlux')
All units of dimension 'MagneticFlux': abWb - abweber Mx - maxwell phi_0 - magnetic flux quantum statWb - statweber Wb - weber ['SI'] Get the base SI units of any unit above by calling rewrite(,'SI'). SI units accept all SI prefixes. For details, see SI Unit Prefixes List.

unitInfoalso returns information on compound units. Find information onu.m/u.s^2.

unitInfo(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 usingunitInfowithout input arguments.

unitInfo
“AbsorbedDose”“AbsorbedDoseOrDoseEquivalent" "AbsorbedDoseRate" "Acceleration" ... ... "Length" "Luminance" "LuminousEfficacy" ... ... "Torque" "Velocity" "Volume"

Store information returned byunitInfofor use by providing an output.

Store the dimension ofu.C.

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

Find and store all units for the dimensiondimC.

unitsEC = unitInfo(dimC)
unitsEC = [abC] [C] [e] [Fr] [statC]

Find information on the third unit ofunitsEC.

unitInfo(unitsEC(3))
elementary charge - a physical unit of electric charge. Get all units for measuring 'ElectricCharge' by calling unitInfo('ElectricCharge').

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

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

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

numElectrons = double(numElectrons)
numElectrons = 6.2415e+18

Input Arguments

collapse all

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

Example:unitInfo(u.m)whereu = symunit

Dimension, specified as a character vector or string.

Example:unitInfo('Length')

Version History

Introduced in R2017b