MATLAB Object-Oriented Programming

(Joyce) #1
Find Default Values in Property Metadata.............. 16-20
Default Values.................................. 16-20
meta.property Data.............................. 16-20

Specialize Object Behavior


17


Methods That Modify Default Behavior.................. 17-2
How to Customize Class Behavior ..................... 17-2
Which Methods Control Which Behaviors ............... 17-2
Overload Functions and Override Methods.............. 17-4

Number of Arguments for subsref and subsasgn .......... 17-6
How MATLAB Determines Number of Arguments......... 17-6
Syntax for subsref, and subsasgn Methods.............. 17-8

Modify nargout and nargin for Indexing Methods ......... 17-9
When to Modify Number of Arguments................. 17-9
How to Modify Number of Arguments.................. 17-9

Concatenation Methods ............................. 17-11
Default Concatenation............................ 17-11
Methods to Overload............................. 17-11

Object Converters.................................. 17-12
Why Implement Converters........................ 17-12
Converters for Package Classes ..................... 17-12
Converters and Subscripted Assignment............... 17-13

Object Array Indexing............................... 17-15
Default Indexed Reference and Assignment ............ 17-15
What You Can Modify............................. 17-16
When to Modify Indexing Behavior................... 17-17
Built-In subsref and subsasgn Called in Methods........ 17-17
Avoid Overriding Access Attributes ................... 17-19

Code Patterns for subsref and subsasgn Methods........ 17-21
Customize Indexed Reference and Assignment.......... 17-21
Syntax for subsref and subsasgn Methods............. 17-21
Indexing Structure Describes Indexing Expressions ...... 17-22

xxvii
Free download pdf