User`s guide
mbintscalar
7-14
7mbintscalar
Purpose Assert variable is integer scalar.
Syntax mbintscalar(n)
Description The statement
mbintscalar(x)
causes the MATLAB Compiler to impute that x is an integer scalar. At
runtime, if
mbintscalar determines that x holds a value other than an integer
scalar,
mbintscalar issues an error message and halts execution of the
MEX-file.
mbintscalar tells the MATLAB interpreter to check whether x holds an
integer scalar value. If
x does not, mbintscalar issues an error message and
halts execution of the M-file. The MATLAB interpreter does not use
mbintscalar to impute x.
Note that
mbintscalar only tests x at the point in an M-file or MEX-file where
an
mbintscalar call appears. In other words, an mbintscalar call tests the
value of
x only once. If x becomes a vector after the mbintscalar test,
mbintscalar cannot issue an error message.
mbintscalar defines an integer scalar as any value that meets the criteria of
both
mbint and mbscalar.
Example This code in MATLAB causes mbintscalar to generate an error message
because, although
n is a scalar, n does not hold a n integer value.
n = 4.2;
mbintscalar(n)
??? Error using ==> mbint
Argument to mbint must be integer.
See Also mbint, mbscalar, mcc