Explanation

Classes in MATLAB fall broadly into two categories—handle classes and value classes. While there are some similarities, there are also significant usage differences for these classes. Code Analyzer cannot always determine with certainty whether a class is a handle class or a value class because it could inherit this property from its superclass.

Code Analyzer produces this message when it detects some usage patterns characteristic of a value class and other usage patterns characteristic of a handle class—an apparent conflict. Two other messages always accompany this message, giving additional information about the behaviors Code Analyzer has seen that suggest this conflict.


Suggested Action

It is very likely that there is a usage conflict. Examine the messages that accompany this one and fix the usage that does not correspond to your intended class behavior. If the class is derived from a superclass that is a handle class, you can indicate this property directly in the class definition by including the handle explicitly as a superclass, as shown in the following example:

classdef myclass < superclass & handle

This makes it clear to Code Analyzer (and others reading the class) that the class is a handle class. This could be enough to suppress inappropriate messages. In general, Code Analyzer cannot be certain that the problem exists without evaluating additional files. Therefore, it could be appropriate to suppress this message, as described in Adjust Code Analyzer Message Indicators and Messages.