MATLAB Compiler | ![]() ![]() |
Assert variable is real scalar
Syntax
Description
causes the MATLAB Compiler to impute that x
is a real scalar. At run-time, if mbrealscalar
determines that x
holds a value other than a real scalar, mbrealscalar
issues an error message and halts execution of the MEX-file.
mbrealscalar
tells the MATLAB interpreter to check whether x
holds a real scalar value. If x
does not, mbrealscalar
issues an error message and halts execution of the M-file. The MATLAB interpreter does not use mbrealscalar
to impute x
.
Note that mbrealscalar
only tests x
at the point in an M-file or MEX-file where an mbrealscalar
call appears. In other words, an mbrealscalar
call tests the value of x
only once. If x
becomes a vector after the mbrealscalar
test, mbrealscalar
cannot issue an error message.
mbrealscalar
defines a real scalar as any value that meets the criteria of both mbreal
and mbscalar
.
Example
This code in MATLAB causes mbrealscalar
to generate an error message because, although n
contains only real numbers, n
is not a scalar:
See Also
mbreal
, mbscalar
, mbrealvector
, mcc
![]() | mbreal | mbrealvector | ![]() |