Programming Previous page   Next Page

Creating a Portfolio

Suppose you have implemented a collection of asset subclasses in a manner similar to the stock class. You can then use a portfolio object to present the individual's financial portfolio. For example, given the following assets

create a portfolio object:

The portfolio display method summarizes the portfolio contents (because this statement is not terminated by a semicolon).

The portfolio pie3 method displays the relative mix of assets using a pie chart.


Previous page  The Portfolio pie3 Method Saving and Loading Objects Next page

© 1994-2005 The MathWorks, Inc.