MATLAB Object-Oriented Programming

(Joyce) #1
Built-In Data Value Methods........................ 12-55
Built-In Data Organization Methods .................. 12-56
Built-In Indexing Methods......................... 12-57
Built-In Concatenation Methods..................... 12-57

Subclasses of Built-In Types Without Properties ......... 12-60
Specialized Numeric Types ......................... 12-60
A Class to Manage uint8 Data ....................... 12-60
Using the DocUint8 Class.......................... 12-61

Subclasses of Built-In Types with Properties ............ 12-68
Specialized Numeric Types with Additional Data Storage.. 12-68
Subclasses with Properties ......................... 12-68
Property Added................................. 12-69
Methods Implemented............................ 12-69
Class Definition Code ............................. 12-69
Using ExtendDouble.............................. 12-72
Concatenation of ExtendDouble Objects............... 12-75

Use of size and numel with Classes .................... 12-77
size and numel.................................. 12-77
Built-In Class Behavior............................ 12-77
Subclasses Inherit Behavior........................ 12-78
Classes Not Derived from Built-In Classes ............. 12-79
Change the Behavior of size or numel................. 12-81
Overload numArgumentsFromSubscript Instead of numel.. 12-82

Representing Hardware with Classes.................. 12-83
Objective ...................................... 12-83
Why Derive from int32............................ 12-83
Implementation ................................. 12-83
Construct MuxCard Object......................... 12-84
Call Methods of int32............................. 12-85

Determine Array Class.............................. 12-87
Query the Class Name............................ 12-87
Test for Array Class .............................. 12-87
Test for Specific Types............................ 12-88
Test for Most Derived Class ........................ 12-89

Abstract Classes ................................... 12-91
Abstract Classes................................. 12-91
Declare Classes as Abstract........................ 12-92

xxii Contents

Free download pdf