Programming Previous page   Next Page

Classes and Objects


Classes and Objects: An Overview
Using object-oriented programming in MATLAB
Designing User Classes in MATLAB
The basic set of methods that should be included in a class
Overloading Operators and Functions
Overloading the MATLAB operators and functions to change their behavior
Example -- A Polynomial Class
Example that defines a new class to implement a MATLAB data type for polynomials
Building on Other Classes
Inheritance and aggregation
Example -- Assets and Asset Subclasses
An example that uses simple inheritance
Example -- The Portfolio Container
An example that uses aggregation
Saving and Loading Objects
Saving and retrieving user-defined objects to and from MAT-files
Example -- Defining saveobj and loadobj for Portfolio
Defining methods that automatically execute on save and load
Object Precedence
Determining which operator or function to call in a given situation
How MATLAB Determines Which Method to Call
How function arguments and precedence determine which method to call


Previous page  Debugging Errors and Warnings Classes and Objects: An Overview Next page

© 1994-2005 The MathWorks, Inc.