Products & Services Solutions Academia Support User Community Company

Learn more about MATLAB   

Class Methods

What Are Methods

Methods are functions that implement the operations performed on objects of a class. Methods, along with other class members support the concept of encapsulation—class instances contain data in properties and class methods operate on that data. This allows the internal workings of classes to be hidden from code outside of the class, and thereby enabling the class implementation to change without affecting code that is external to the class.

Methods have access to private members of their class including other methods and properties. This enables you to hide data and create special interfaces that must be used to access the data stored in objects.

See Methods That Modify Default Behavior for a discussion of how to create classes that modify standard MATLAB behavior.

See Class Folders for information on the use of @ and path directors and packages to organize your class files.

See Methods In Separate Files for the syntax to use when defining classes in more than one file.

Kinds of Methods

There are specialized kinds of methods that perform certain functions or behave in particular ways:

  


Recommended Products

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