The code uses the indicated operator, or the result of that operator, in a
context where MATLAB expects a scalar value. But the indicated operator
typically returns an array value. For example: if x .* y
elicits this message, because the .*
operator typically
results in arrays. (In this case, if x
and
y
are scalars, use the *
operator.)
Determine whether there is a bug or a typographical error and if so, fix the code. If Code Analyzer is wrong, for example, because the indicated operator is overloaded so as to return a scalar value, then suppress the message as described in Adjust Code Analyzer Message Indicators and Messages. For information on overloading operators, see “Implementing Operators for Your Class”.