Units - Maple Help

Home : Support : Online Help : Science and Engineering : Units : Manipulating Units : Units/HasUnit

Units

 HasUnit
 test whether a unit exists

 Calling Sequence HasUnit(unit, opts)

Parameters

 unit - symbol; unit name opts - (optional) equation(s) of the form option=value where option is 'display'; specify options

Description

 • The HasUnit(unit) function returns true if the name is accepted as a unit name. Otherwise, false is returned.
 'display'=truefalse
 If this option is true and the unit unit is accepted as a valid unit name, the default spelling with context is returned instead of true. Otherwise, false is returned.

Examples

 > $\mathrm{with}\left(\mathrm{Units}\right):$
 > $\mathrm{HasUnit}\left('\mathrm{cm}'\right)$
 ${\mathrm{true}}$ (1)
 > $\mathrm{HasUnit}\left('{\mathrm{mile}}_{\mathrm{US_survey}}'\right)$
 ${\mathrm{true}}$ (2)
 > $\mathrm{HasUnit}\left('\mathrm{Ω}','\mathrm{display}'=\mathrm{true}\right)$
 ${{\mathrm{ohm}}}_{{\mathrm{SI}}}$ (3)
 > $\mathrm{HasUnit}\left('\mathrm{ω}'\right)$
 ${\mathrm{false}}$ (4)
 >