This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Class File Organization

Class syntax, attributes, and organization in files and folders

Specify class attributes in the class definition block and organize class files and folders using packages. Learn how MATLAB® evaluates expressions used in class definitions.


classdefClass definition keywords
importAdd package or class to current import list


Defining Classes

User-Defined Classes

MATLAB enables you to define classes to implement object-oriented designs.

Class Attributes

Class attributes enable you to modify the behavior of classes that you define.

Class and Package Folders

Folders Containing Class Definitions

Define special folders for class files to contain multiple files for class definitions.

Packages Create Namespaces

Use packages to organize classes into separate namespaces.

Class Precedence

Specify a relative precedence among user-defined classes

Import Classes

Import classes into functions to simplify name references.

Expressions in Classes

Evaluation of Expressions in Class Definitions

You can use MATLAB expressions to define values for attributes and properties.