MATLAB Object-Oriented Programming

(Joyce) #1

Subclasses of MATLAB Built-In Types


In this section...
“MATLAB Built-In Types” on page 12-50
“Built-In Types You Can Subclass” on page 12-50
“Why Subclass Built-In Types” on page 12-51
“Which Functions Work with Subclasses of Built-In Types” on page 12-51
“Behavior of Built-In Functions with Subclass Objects” on page 12-51
“Built-In Subclasses That Define Properties” on page 12-52

MATLAB Built-In Types


Built-in types represent fundamental kinds of data such as numeric arrays, logical arrays,
and character arrays. Other built-in types like cell arrays and structures contain data
belonging to any class.

Built-in types define methods that perform operations on objects of these classes. For
example, you can perform operations on numeric arrays such as, sorting, arithmetic, and
logical operations.

See “Fundamental MATLAB Classes” for more information on MATLAB built-in classes.

NoteIt is an error to define a class that has the same name as a built-in class.

Built-In Types You Can Subclass


You can subclass MATLAB numeric classes and the logical class. For a list of numeric
types, see “Numeric Types”.

You cannot subclass any class that has its Sealed attribute set to true. To determine if
the class is Sealed, query the class metadata:

mc = ?ClassName;
mc.Sealed

A value of 0 indicates that the class is not Sealed and can be subclasses.

12 How to Build on Other Classes

Free download pdf