Main Content

Handle Classes

Classes can support reference or value semantics

Create the appropriate type of class for your application:

  • Value classes enable you to create new array classes that have the same semantics as numeric classes.

  • Handle classes define objects that reference theobject. Copying an object creates another reference to the same object.

For a discussion of how object users work with handle objects, seeHandle Object Behavior.

Functions

isequal 确定数组平等
eq Determine equality

Classes

handle Superclass of all handle classes
matlab.mixin.SetGet Provide handle classes with set and get methods
matlab.mixin.SetGetExactNames Require exact name match for set and get methods
dynamicprops Superclass for classes that support dynamic properties
matlab.mixin.Copyable Superclass providing copy functionality for handle objects

Methods

addlistener Create event listener bound to event source
listener Create event listener without binding to event source
notify Notify listeners that event is occurring
delete Delete handle object
findobj Find handle objects
findprop Findmeta.propertyobject
isvalid Determine valid handles
relationaloperators Determine equality or sort handle objects

Topics

Characteristics of Handle and Value Classes

Building on the Handle Class

  • The Handle Superclass
    Thehandleclass implements methods to support events and listeners, destructors, relational operations, and other operations.
  • Handle Class Destructor
    Define a delete method to customize what happens when MATLAB destroys handle objects.

Working with Handle Classes