The indicated token appears to be the beginning of a statement that is not
preceded by a separator (a comma, semicolon, or newline). Following conditional
expressions inside of if
, elseif
, and
while
statements with a separator makes it clear and
unambiguous where the expression ends and the next statement begins.
Sometimes, this message arises from a typographical error. For example, if you type:
if a ~ b
when you meant to type:
if a ~= b
then MATLAB interprets a
as the conditional expression, and
~ b
as a statement to execute.
If the indicated token is the beginning of the next statement, precede the statement with a comma, semicolon, or newline character. If the message is the result of a typographical error, then correct it.