| 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 basic components in the class definition are blocks describing the whole class and specific aspects of its definition:
classdef block contains the class definition within a file that starts with the classdef keyword and terminates with the end keyword.
properties block (one for each unique set of attribute specifications) contains property definitions, including optional initial values. The properties block starts with the properties keyword and terminates with the end keyword.
methods block (one for each unique set of attribute specifications) contains function definitions for the class methods. The methods block starts with the methods keyword and terminates with the end keyword.
events block (one for each unique set of attribute specifications) contains the names of events that this class declares. The events blocks starts with the events keyword and terminates with the end keyword.
properties, methods, and events are keywords only within a classdef block.
Defining Classes — Syntax for more detail on class syntax.
Defining Properties for information on specifying properties.
Class Methods for information on specifying methods.
Defining Events and Listeners — Syntax and Techniques for information on the use of events.
Attribute Tables for a list of all attributes.
![]() | Class Folders | The Classdef Block | ![]() |

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 |