mustBeScalar
R2026bSyntax
Description
mustBeScalar( throws an error if
value)value is not a scalar. A scalar has dimensions of 1-by-1. This function
does not return a value. mustBeScalar calls the isscalar function to determine if the input is a scalar.
Class support: All numeric classes, logical, char,
string, and MATLAB® classes that implement isscalar.
Examples
Input Arguments
Tips
mustBeScalaris designed to be used for property and function argument validation.
Extended Capabilities
Version History
Introduced in R2026b