MATLAB Object-Oriented Programming

(Joyce) #1

Default Object


A default object is the object returned by calling the class constructor with no arguments.
MATLAB uses default objects in these situations:



  • Indexed assignment creates an array with gaps in array elements. For example, assign
    the first element of array h to index 5 :


h(5) = ClassA(arg1,arg2);

MATLAB fills the unassigned positions with default objects.


  • Loading a heterogeneous array from a MAT-file when the class definition of a specific
    object in the array is not available. MATLAB replaces the object with the default
    object.


Designing Heterogeneous Class Hierarchies
Free download pdf