FUNCTION REFERENCE

methods

List the public methods of a class.

List the public methods of a class.

Syntax

methods(obj); methods('Name')

Syntax

names = methods(obj); names = methods('Name')

For an object of a classdef class, or the name of a class file in the Current Folder, returns the public methods sorted by character code (upper case before lower case), as a column cell. The constructor is included, also the default one of a class without a constructor. Without an output it prints "Methods for class Name:" and one name per line, indented four spaces, with a blank line before and after the heading. For inline, MException and containers.Map objects (or those class names) it lists their fixed method tables.

Example

m = methods('MException'); m{1}   % 'MException'

Differences from MATLAB: The listing prints one name per line. Other built-in classes such as double are not supported yet. The -full option is not supported.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.