| MATLAB Compiler | ![]() |
Assert variable is integer scalar
Syntax
Description
causes the MATLAB Compiler to impute that x is an integer scalar. At run-time, 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 an integer value:
See Also
| mbint | mbintvector | ![]() |