Esta página aún no se ha traducido para esta versión. Puede ver la versión más reciente de esta página en inglés.
Cree el tipo de clase apropiado para su aplicación:
Las clases de valores permiten crear nuevas clases de arreglos que tienen la misma semántica que las clases numéricas.
Las clases de identificadores definen objetos que hacen referencia al object
. Si se copia un objeto, se crea otra referencia al mismo objeto.
Para ver un análisis más detallado acerca de cómo los usuarios de objetos trabajan con objetos identificadores, consulte Handle Object Behavior.
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 |
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 meta.property object |
isvalid | Determine valid handles |
relationaloperators | Determine equality or sort handle objects |
Comparison of Handle and Value Classes
Value objects are associated with a specific variable. Handle objects can be referenced by multiple variables.
Whether you implement a handle or value class depends on what your class represents and how you want objects to behave.
MATLAB® handle variables support reference semantics.
The handle
class implements methods to support events and listeners, destructors, relational operations, and other operations.
Define a delete method to customize what happens when MATLAB destroys handle objects.
Find Handle Objects and Properties
Find objects using regular expressions or obtain the meta.property
object 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 the matlab.mixin.Copyable
class.
Enable both handle and value classes to derive from a specific class.