MATLAB Object-Oriented Programming

(Joyce) #1

Sample Implementation


The following class hierarchy defines a subclass that builds object arrays in its
constructor. The root superclass of the hierarchy initializes the superclass part of the
objects in the array.

This class hierarchy represents members of an engineering team. The classes in the
hierarchy include:


  • TeamMembers — Superclass for specific team member classes, like
    ProjectEngineer. TeamMembers defines the Name and PhoneX properties and
    derives from matlab.mixin.Heterogeneous.

  • ProjectEngineer — Team members that are engineers. Each instance inherits a
    Name and PhoneX property and defines a billing Rate property.

  • Other members — Other types of team members not implemented for this example for
    simplicity.


10 Object Arrays

Free download pdf