unitInfo

Physical quantity that a unit measures.

Category: Symbolic Computations in MATLAB > Units of Measurement

Syntax

name = unitInfo(u)

Returns the quantity name, such as "Force".

Description

unitInfo tells what a unit is used for: m is a "Length", kg a "Mass", N a "Force" and Pa a "Pressure". Units that measure the same quantity can be converted into one another.

Input arguments

u
A unit.

Output arguments

name
String scalar with the physical quantity.

Example

Quantity names

u = symunit;
unitInfo(u.m)
unitInfo(u.kg)
unitInfo(u.N)
unitInfo(u.Pa)
Output
ans = "Length"
ans = "Mass"
ans = "Force"
ans = "Pressure"

Notes

The name is returned in English, as in MATLAB.

See also

symunit unitConvert baseUnits derivedUnits