| MATLAB Compiler | ![]() |
Syntax
mbvector(n)
Description
mbvector(x)
causes the MATLAB Compiler to impute that x is a vector. At runtime, if mbvector determines that x holds a nonvector value, mbvector issues an error message and halts execution of the MEX-file.
mbvector causes the MATLAB interpreter to check whether x holds a vector value. If x does not, mbvector issues an error message and halts execution of the M-file. The MATLAB interpreter does not use mbvector to impute x.
Note that mbvector only tests x at the point in an M-file or MEX-file where an mbvector call appears. In other words, an mbvector call tests the value of x only once. If x becomes a nonvector after the mbvector test, mbvector cannot issue an error message.
mbvector defines a vector as any matrix whose dimensions are 1-by-n or n-by-1. All scalars are also vectors (though most vectors are not scalars).
Example
This code in MATLAB causes mbvector to generate an error message because the dimensions of n are 2-by-2.
n = magic(2)
n =
1 3
4 2
mbvector(n)
??? Error using ==> mbvector
Argument to mbvector must be a vector.
See Also
mbint, mbintscalar, mbintvector, mbreal, mbrealscalar, mbscalar, mbrealvector, mcc
| mbscalar | reallog | ![]() |