| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
| On this page… |
|---|
The classdef block contains the class definition. The classdef line is where you specify:
Class attributes
Superclasses
The classdef block contains the properties, methods, and events subblocks.
Class attributes modify class behavior in some way. Assign values to class attributes only when you want to change their default value.
No change to default attribute values:
classdef class_name ... end
One or more attribute values assigned:
classdef (attribute1 = value,...) ... end
See Class Attributes for a list of attributes and a discussion of the behaviors they control.
To define a class in terms of one or more other classes by specifying the superclasses on the classdef line:
classdef class_name < superclass_name ... end
See Creating Subclasses — Syntax and Techniques for more information.
![]() | Class Components | Specifying Properties | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |