User`s guide
mbvector
7-20
7mbvector
Purpose Assert variable is vector.
Syntax mbvector(n)
Description The statement
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 hal ts 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 callappears.Inother words,anmbvector call teststhevalueofx only
once. If
x becomes a nonvector after the mbvector test, mbvector cannot i ssue
an error message.
mbvector definesavectora sanymatrix whosedimensionsare 1-by-norn-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