Programming Previous page   Next Page

Indexing an Object with Another Object

When MATLAB encounters an object as an index, it calls the subsindex method defined for the object. For example, suppose you have an object a and you want to use this object to index into another object b.

A subsindex method might do something as simple as convert the object to double format to be used as an index, as shown in this sample code.

subsindex values are 0-based, not 1-based.


Previous page  Defining end Indexing for an Object Converter Methods Next page

© 1994-2005 The MathWorks, Inc.