MATLAB Object-Oriented Programming

(Joyce) #1

  • Textual description

  • Type (stock, bond, or cash)

  • Means to determine the current value of the asset


Heterogeneous arrays of these objects need methods that can operate on the whole array.
These operations include:



  • Creating a table of information about all assets contained in the array

  • Graphing the relative contribution of each asset type contained in the array


These requirements are factored into the class that is the root of the hierarchy. The root
class derives from matlab.mixin.Heterogeneous. In the following diagram, the
Assets class is the root of the hierarchy. The Stocks, Bonds, and Cash classes provide
the specialization required for each type of asset.


A Class Hierarchy for Heterogeneous Arrays
Free download pdf