User`s guide
B Error and Warning Messages
B-4
Error: File:
filename
Line: # Column: # () indexing must appear last in an index expression.
If you use ordinary array indexing () to index into an expression, i t must be
last in the index express io n. F or e xamp le , y o u can use
X(1).value and
X{2}(1), but you cannot use X.value(1) or X(1){2}.
Error: File:
filename
Line: # Column: # A CONTINUE may only be used within a FOR or WHILE
loop.
Use CONTINUE to pass control to the next iteration of a FOR or WHILE loop.
Error: File:
filename
Line: # Column: # A function declaration cannot appear within a script
M-file. The re is a functi on declar ati on in the fil e to be co mpile d , but it is not at
the beginning of the file. Scripts cannot have any function declarations;
function M-files must start with a function.
Error: File:
filename
Line: # Column: # Assignment statements cannot produce a result. An
assignment stateme nt canno t be used in a place where an expr es s ion, b ut not
a statement, is expected. In particular, this message often identifies errors
where an as s ignme nt was used, but an equ alit y test was inte nded. For
exampl e,
if x == y, z = w; end % Correct
if x = y, z = w; end % Incorrect
Error: File:
filename
Line: # Column: # A variable cannot be made
storageclass1
after being
used as a
storageclass2
. You cannot change a variable’s storage class (global/
local/persistent). Eventhough MATLABallowsthistypeofchangeinscope,the
Compiler does not.
Error: File:
filename
Line: # Column: # An array for multiple LHS assignment must be a vector.
If the left-hand side of a statement is a multiple assignment, the list of
left-hand side variables must be a vector. For example,
[p1, p2, p3] = myfunc(a) % Correct
[p1; p2; p3] = myfunc(a) % Incorrect
Error: File:
filename
Line: # Column: # An array for multiple LHS assignment cannot be
empty.
If the left-hand side of a statement is a multiple assignment, the list of
left-hand s id e variables ca nnot be empty. For example,
[p1, p2, p3] = myfunc(a) % Correct
[ ] = myfunc(a) % Incorrect