Classi handle
Le classi handle supportano la semantica di riferimento
Un costruttore di classe handle restituisce un oggetto handle che è un riferimento all'oggetto creato. È possibile assegnare l'oggetto handle a più variabili o passarlo alle funzioni senza che MATLAB® faccia una copia dell'oggetto originale. Per una discussione su come lavorare con gli oggetti handle, vedere Handle Object Behavior.
Funzioni
| isequal | Determine array equality | 
| eq | Determine equality | 
| matlab.lang.invalidHandle | Construct array of invalid handles (Da R2024b) | 
Classi
| 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 | 
| matlab.lang.WeakReference | Weak reference to handle object (Da R2024b) | 
| matlab.lang.HandlePlaceholder | Basic subclass of handle(Da R2024b) | 
Metodi
| 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 | Find matlab.metadata.Propertyobject | 
| isvalid | Determine valid handles | 
| relationaloperators | Determine equality or sort handle objects | 
Argomenti
Caratteristiche delle classi handle e di valore
- Comparison of Handle and Value Classes
 Value objects are associated with a specific variable. Handle objects can be referenced by multiple variables.
- Which Kind of Class to Use
 Whether you implement a handle or value class depends on what your class represents and how you want objects to behave.
- Handle Object Behavior
 MATLAB handle variables support reference semantics.
Costruzione sulla classe handle
- 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.
Utilizzo delle classi handle
- Find Handle Objects and Properties
 Find objects using regular expressions or obtain thematlab.metadata.Propertyobject for specific properties.
- Implement Set/Get Interface for Properties
 Create a set/get interface for your handle class.
- Implement Copy for Handle Classes
 Customize object copy operations by deriving from thematlab.mixin.Copyableclass.
- Handle Compatible Classes
 Enable both handle and value classes to derive from a specific class.
- Weak Reference Handles
 Create weak references to handle classes. (Da R2024b)