MATLAB Compiler    
mbrealvector

Assert variable is a real vector

Syntax

Description

The statement

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:

See Also

mbreal, mbrealscalar, mbvector, mcc


  mbrealscalar mbscalar