User`s guide

mbscalar
7-19
7mbscalar
Purpose Assert variable is scalar.
Syntax mbscalar(n)
Description The statement
mbscalar(x)
causes the MATLAB Compiler to impute that x is a scalar. At runtime, if
mbscalar determines that x holds a nonscalar value, mbscalar issues an error
message and halts execution of the MEX-file.
mbscalar tells the MATLAB interpreter to check whether
x holds a scalar
value. If
x does not, mbscalar issues an error message and halts execution of
the M-file. The M ATLAB interpreter does not use
mbscalar to impute x.
Note that
mbscalar only tests x at the point in an M-file or MEX-file where an
mbscalar callappears.Inotherwords,an mbscalar calltests thevalueof x only
once. If
x becomes nonscalar after the mbscalar test, mbscalar cannot issue an
error message.
mbscalar defines a scalar as a matrix whose dimensions are 1-by-1.
Example This code in MATLAB causes mbscalar to generate an error message because
n does not hold a scalar.
n = [1 2 3];
mbscalar(n);
??? Error using ==> mbscalar
Argument of mbscalar must be scalar.
See Also mbint, mbintscalar, mbintvector, mbreal, mbrealscalar, mbrealvector,
mbvector, mcc