validateLengthUnit
Validate and standardize length unit
Syntax
Description
checks
that standardName
= validateLengthUnit(unit
)unit
is a valid length unit and converts it
to a standard unit name. The function is case-insensitive with respect
to its input. Spaces, periods, and apostrophes are ignored. Plural
forms are accepted in most cases, but the result, standardName
is
always singular.
checks
that standardName
= validateLengthUnit(unit
,funcName
,varName
,argIndex
)unit
is a valid length unit and, if it isn’t,
creates an error message using the optional inputs funcName
, varName
,
and argIndex
in error message formatting, with
behavior identical to that provided by the validateattributes
inputs
of the same names.
Examples
Input Arguments
Output Arguments
Version History
Introduced before R2006a