MATLAB Object-Oriented Programming

(Joyce) #1

Class Method to Implement Description


disp


display


Called when you enter disp(obj) on the
command line

Called by statements that are not terminated by
semicolons. disp is often used to implement
display methods.

See “Overloading the disp Function” on page 18-
42

See “Custom Display Interface” on page 18-2

Converting Objects to Other Classes


converters like double and char Convert an object to a MATLAB built-in class


See “The Character Converter” on page 19-16
and “The Double Converter” on page 19-15

Indexing Objects


subsref and subsasgn Enables you to create nonstandard indexed
reference and indexed assignment


See “Object Array Indexing” on page 17-15

end Supports end syntax in indexing expressions
using an object; e.g., A(1:end)


See “end as Object Index” on page 17-35

numel Determine the number of elements in an array


See “Modify nargout and nargin for Indexing
Methods” on page 17-9

numArgumentsFromSubscript Overload to specify the number of values to return
from indexing expressions.


See “Number of Arguments for subsref and
subsasgn” on page 17-6

Methods That Modify Default Behavior
Free download pdf