Class Overview

MATLAB® User-Defined Classes

A MATLAB® class definition is a template whose purpose is to provide a description of all the elements that are common to all instances of the class. Class members are the properties, methods, and events that define the class.

MATLAB classes are defined in code blocks, with sub-blocks delineating the definitions of various class members. See classdef Syntax for details on the classdef block.

Attributes for Class Members

Attributes modify the behavior of classes and the members defined in the class-definition block. For example, you can specify that methods are static or that properties are abstract, and so on. The following sections describe these attributes:

Class definitions can provide information, such as inheritance relationships or the names of class members without actually constructing the class. See Obtaining Information About Classes with Meta-Classes.

See Specifying Attributes for more on attribute syntax.

Kinds of Classes

There are two kinds of MATLAB classes—handle and value classes.

See Comparing Handle and Value Classes for a more complete discussion.

Creating Class Hierarchies

For more information on how to define class hierarchies, see Building on Other Classes .

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS