User`s guide
mbrealvector
7-17
7mbrealvector
Purpose Assert variable is a real vector
Syntax mbrealvector(n)
Description The statement
mbrealvector(x)
causes the MATLAB Compiler to impute that x is a real vector. At run-time, if
mbrealvector determines that x holds a value other than a real vector,
mbrealvector issues an error message and halts execution of the MEX-file.
mbrealvector tells the MATLAB interpreter to check whether x holds a real
vector value. If
x does not, mbrealvector issues an error message and halts
execution of the M-file. The MATLAB interpreter does not use
mbrealvector
to impute
x.
Note that
mbrealvector only tests x at the point in an M-file or MEX-file where
an
mbrealvector call appears. In other words, an mbrealvector call tests the
value of
x only once. If x becomes complex after the mbrealvector test,
mbrealvector cannot issue an error message.
mbrealvector defines a real vector as any value that meets the criteria of both
mbreal and mbvector. Note that mbrealvector considers real scalars to be real
vectors as well.
Example This code in MATLAB causes mbrealvector to generate an error message
because, although
n is a vector, n contains one imaginary number:
n = [5 2+3i];
mbrealvector(n)
??? Error using ==> mbreal
Argument to mbreal must be real.
See Also mbreal, mbrealscalar, mbvector, mcc