Explanation

The code does not appear to use the assignment to the indicated variable. This situation occurs when any of the following are true:

Because MATLAB can use variables in unusual ways, Code Analyzer can produce this message inappropriately. For example, Code Analyzer is unable to detect which variables eval and similar functions use.


Suggested Action

If a value is unnecessary, delete the assignment.

If the message displays because of a typographical error, fix the error.

If the code must ignore some output argument values, use the tilde operator (~) to replace the unused argument. This tilde operator eliminates unused argument names from your program, and clarifies your intent to ignore the returned values. MATLAB introduced the tilde operator in R2009b; therefore, use it only when running version R2009b or later.

If the message is unwarranted, suppress it, as described in Adjust Code Analyzer Message Indicators and Messages. Consider including a comment in your code explaining the reason for this suppression. For more information, see “Ignoring Selected Outputs or Input Arguments”.