Main Content

Aufbau und Arbeit mit Objekt-Arrays

Aufbau und Verknüpfung von Objekt-Arrays; heterogene Arrays

Aufbau von Objekt-Arrays, Referenzobjekten und deren Eigenschaften aufgrund von Arrays und Entwicklung von Klassenhierarchien, die die Bildung von heterogenen Arrays (gemischten Klassen) unterstützen.

Funktionen

createArrayCreate array of specified class and value (Seit R2024a)
emptyCreate empty array of specified class

Klassen

matlab.mixin.HeterogeneousSuperclass for heterogeneous array formation

Themen

Aufbauen und Zugreifen auf Objekt-Arrays

Verknüpfungsarrays

Klassenkonvertierungen

  • 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.

Heterogene Arrays

  • 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.