Construcción y trabajo con arreglos de objetos
Construcción y concatenación de arreglos de objetos; arreglos heterogéneos
Construya arreglos de objetos, objetos de referencia y sus propiedades a partir de arreglos, y diseñe jerarquías de clase que admitan la formación de arreglos heterogéneos (clase mixta).
Funciones
empty | Create empty array of specified class |
Clases
matlab.mixin.Heterogeneous | Superclass for heterogeneous array formation |
Temas
Construir arreglos de objetos
- Construir arreglos de objetos
Construya arreglos de objetos en el constructor y devuelva el arreglo como el argumento de salida. - Initialize Object Arrays
MATLAB® calls the class constructor with no arguments to initialize array elements with a default object. - Initialize Arrays of Handle Objects
MATLAB uses a default object to initialize the empty elements of an array of handle objects. - Empty Arrays
Empty arrays have no elements, but are of a certain class. - Accessing Dynamic Properties in Arrays
Access dynamic properties in object arrays by referring to individual objects.
Concatenación de arreglos
- Concatenation Methods
You can concatenate objects into arrays. - Concatenating Objects of Different Classes
MATLAB follows specific rules when you attempt to create an array with objects of different classes.
Convertidores de objetos y clase de arreglos
- Implicit Class Conversion
MATLAB can implicitly convert objects to a different class for concatenation, subscripted assignment, property validation, and argument validation. - Object Converters
You can convert an object of one class to an object of another class. - Determine Array Class
You can determine the class of an array.
Arreglos heterogéneos
- Designing Heterogeneous Class Hierarchies
Heterogeneous arrays can contain objects of different class, but all objects in the array must derive from a common superclass. - Heterogeneous Array Constructors
The class of a heterogeneous object array can change as you add array elements of different classes. You must ensure that constructors return objects that are the same class as the class defining the constructor.