Programming Previous page   Next Page

Converter Methods

A converter method is a class method that has the same name as another class, such as char or double. Converter methods accept an object of one class as input and return an object of another class. Converters enable you to

A converter function call is of the form

where a is an object of a class other than classname. In this case, MATLAB looks for a method called classname in the class directory for object a. If the input object is already of type classname, then MATLAB calls the constructor, which just returns the input argument.

Examples of Converter Methods

See the following sections for examples of converter methods:


Previous page  Indexing an Object with Another Object Overloading Operators and Functions Next page

© 1994-2005 The MathWorks, Inc.