Programming Previous page   Next Page

The Stock display Method

When you issue the statement (without terminating with a semicolon)

MATLAB looks for a method in the @stock directory called display. The display method for the stock class produces this output.

Here is the stock display method.

First, the parent asset object is passed to the asset display method to display its fields (MATLAB calls the asset display method because the input argument is an asset object). The stock object's fields are displayed in a similar way using a formatted text string.

Note that if you did not implement a stock class display method, MATLAB would call the asset display method. This would work, but would display only the descriptor, date, type, and current value.


Previous page  The Stock subsasgn Method Example -- The Portfolio Container Next page

© 1994-2005 The MathWorks, Inc.