Costruzione e utilizzo degli array di oggetti
Costruire e concatenare array di oggetti; array eterogenei
Costruire array di oggetti, referenziare gli oggetti e le loro proprietà dagli array e progettare gerarchie di classi che supportino la formazione di array (di classi miste) eterogenei.
Funzioni
createArray | Create array of specified class and value (Da R2024a) |
empty | Create empty array of specified class |
Classi
matlab.mixin.Heterogeneous | Superclass for heterogeneous array formation |
Argomenti
Costruzione e accesso ad array di oggetti
- Create and Initialize Object Arrays
Build object arrays using several different methods. - Accessing Properties and Methods in Object Arrays
You can access properties and invoke methods of object arrays as a whole or work with individual elements of the array. - Determine Array Class
You can determine the class of an array.
Concatenazione di array
- 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.
Conversioni di classe
- 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.
Array eterogenei
- 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.