User`s guide

mbintvector
7-14
7mbintvector
Purpose Assert variable is integer vector
Syntax mbintvector(n)
Description The statement
mbintvector(x)
causes the MATLAB Compiler to impute that x is an integer vector. At
run-time, if
mbintvector determines that x holds a value other than an integer
vector,
mbintvector issues an error message and halts execution of the
MEX-file.
mbintvector tells the MATLAB interpreter to check whether x holds an
integer vector value. If
x does not, mbintvector issues an error message and
halts execution of the M-file. The MATLAB interpreter does not use
mbintvector to impute x.
Note that
mbintvector only tests x at the point in an M-file or MEX-file where
an
mbintvector call appears. In other words, an mbintvector call tests the
value of
x only once. If x becomes a two-dimensional matrix after the
mbintvector test, mbintvector cannot issue an error message.
mbintvector defines an integer vector as any value that meets the criteria of
both
mbint and mbvector. Note that mbintvector considers integer scalars to
be integer vectors as well.
Example This code in MATLAB causes mbintvector to generate an error message
because, although all the values of
n are integers, n is a matrix rather than a
vector:
n = magic(2)
n =
1 3
4 2
mbintvector(n)
??? Error using ==> mbvector
Argument to mbvector must be a vector.
See Also mbint, mbvector, mbintscalar, mcc