User`s guide
Programming
8-13
If you attempt to create a PreGet or PostGet listener for a property that is not declared
as GetObservable, MATLAB issues a MATLAB:class:nonGetObservableProp
warning.
In previous releases, MATLAB did not warn in either case, but did not call the listener
callback function when a set or get event occurred. In a future release, these warnings
will become errors.
Compatibility Considerations
If you use class metadata or the properties function to get a list of properties for which
you create listeners, add warning/error handling for these conditions. A better approach
is to use findobj to get the list of observable properties for any given class and assign
listeners only for those properties.
MATLAB Warns if Property Is Not Member of Class When Defining
Listener
When calling the event.proplistener constructor, or calling the addlistener method with
an array of meta.property objects, warning messages alert you if a property is not a
member of the correct class.
• Nonscalar input objects: if any one of the properties is not a valid member of the
class of the object array, MATLAB issues the MATLAB:class:PropNotMember
warning .
• Scalar input object: if any of the properties are not valid dynamic or class
properties, MATLAB issues the MATLAB:class:DynPropNotMember or
MATLAB:class:PropNotMember warning.
In previous releases, MATLAB did not warn in either case. In a future release, these
warnings will become errors.
Built-In disp Works with Empty Objects
It is now possible to call the built-in disp function with empty objects. For example,
define the TestClass as:
classdef TestClass
properties
PropertyA = 1;