Note: Supplemental materials are not guaranteed with Rental or Used book purchases.
Purchase Benefits
What is included with this book?
Figures | p. xv |
Code Listings | p. xvii |
Tables | p. xxi |
About the Author | p. xxiii |
Preface | p. xxv |
Introduction | p. 1 |
Examples | p. 2 |
Object-Oriented Software Development | p. 2 |
At the Top of Your Game | p. 3 |
Personal Development | p. 3 |
Wicked Problems | p. 5 |
Extreme Programming | p. 6 |
MATLAB, Object-Oriented Programming, and You | p. 8 |
Attributes, Behavior, Objects, and Classes | p. 9 |
From MATLAB Heavyweight to Object-Oriented Thinker | p. 9 |
Object-Oriented Design | p. 10 |
Why Use Objects? | p. 11 |
A Quality Focus | p. 12 |
Reliability | p. 12 |
Reusability | p. 13 |
Extendibility | p. 14 |
Summary | p. 15 |
Group of Eight | p. 17 |
Meeting MATLAB's Requirements | p. 19 |
Variables, Types, Classes, and Objects | p. 19 |
What Is a MATLAB Class? | p. 21 |
Example: Class Requirements | p. 21 |
Class Directory | p. 22 |
Constructor | p. 22 |
The Test Drive | p. 24 |
Summary | p. 26 |
Independent Investigations | p. 27 |
Member Variables and Member Functions | p. 29 |
Members | p. 29 |
Accessors and Mutators | p. 30 |
A Short Side Trip to Examine Encapsulation | p. 31 |
cShape Variables | p. 32 |
cShape Members | p. 33 |
cShape Private Member Variables | p. 33 |
cShape Public Interface | p. 34 |
A Short Side Trip to Examine Function Search Priority | p. 36 |
Example Code: Accessors and Mutators, Round 1 | p. 37 |
Constructor | p. 37 |
Accessors | p. 37 |
Mutators | p. 38 |
Combining an Accessor and a Mutator | p. 39 |
Member Functions | p. 40 |
Standardization | p. 40 |
The Test Drive | p. 41 |
Summary | p. 42 |
Independent Investigations | p. 43 |
Changing the Rules...in Appearance Only | p. 45 |
A Special Accessor and a Special Mutator | p. 45 |
A Short Side Trip to Examine Overloading | p. 45 |
Superiorto and Inferiorto | p. 47 |
The Built-in Function | p. 48 |
Overloading the Operators subsref and subsasgn | p. 48 |
Dot-Reference Indexing | p. 50 |
subsref Dot-Reference, Attempt 1 | p. 51 |
A New Interface Definition | p. 52 |
subsref Dot-Reference, Attempt 2: Separating Public and Private Variables | p. 53 |
subsref Dot-Reference, Attempt 3: Beyond One-to-One, Public-to-Private | p. 53 |
subsref Dot-Reference, Attempt 4: Multiple Indexing Levels | p. 55 |
subsref Dot-Reference, Attempt 5: Operator Conversion Anomaly | p. 57 |
subsasgn Dot-Reference | p. 59 |
Array-Reference Indexing | p. 62 |
subsref Array-Reference | p. 63 |
subsasgn Array-Reference | p. 64 |
Cell-Reference Indexing | p. 65 |
Initial Solution for subsref.m | p. 66 |
Initial Solution for subsasgn.m | p. 68 |
Operator Overload, mtimes | p. 69 |
The Test Drive | p. 70 |
subsasgn Test Drive 24 | p. 70 |
subsref Test Drive | p. 72 |
Summary | p. 74 |
Independent Investigations | p. 75 |
Displaying an Object's State | p. 77 |
Displaying Objects | p. 77 |
What Should Be Displayed? | p. 77 |
Standard Structure Display | p. 79 |
Public Member Variable Display | p. 80 |
Implementing display.m, Attempt 1 | p. 80 |
Implementing display.m, Attempt 2 | p. 81 |
Developer View | p. 83 |
Implementing display.m with Developer View Options | p. 84 |
The Test Drive | p. 86 |
Summary | p. 88 |
Independent Investigations | p. 88 |
fieldnames.m | p. 91 |
Fieldnames | p. 91 |
Code Development | p. 91 |
The Test Drive | p. 93 |
Summary | p. 93 |
Independent Investigations | p. 94 |
struct.m | p. 95 |
Struct | p. 95 |
Code Development | p. 96 |
The Test Drive | p. 97 |
Summary | p. 98 |
Independent Investigations | p. 98 |
get.m, set.m | p. 99 |
Arguments for the Member Functions get and set | p. 99 |
For Developers | p. 99 |
For Clients | p. 100 |
Tab Completion | p. 101 |
Code Development | p. 101 |
Implementing get and set | p. 102 |
Initial get.m | p. 104 |
Initial set.m | p. 107 |
The Test Drive | p. 110 |
Summary | p. 111 |
Independent Investigations | p. 112 |
Simplify Using get, set, fieldnames, and struct | p. 113 |
Improving subsref.m | p. 114 |
Improving subsasgn.m | p. 115 |
Improving display.m | p. 116 |
Test Drive | p. 118 |
Summary | p. 121 |
Independent Investigations | p. 122 |
Drawing a Shape | p. 123 |
Ready, Set, Draw | p. 123 |
Implementation | p. 123 |
Modify the Constructor | p. 124 |
Modify fieldnames | p. 125 |
Modify get | p. 125 |
Modify set | p. 128 |
Modify mtimes | p. 131 |
Modify reset | p. 132 |
Adding Member Function draw | p. 132 |
Test Drive | p. 133 |
Summary | p. 136 |
Independent Investigations | p. 137 |
Building a Hierarchy | p. 139 |
Constructor Redux | p. 141 |
Specifying Initial Values | p. 141 |
Private Member Functions | p. 142 |
Generalizing the Constructor | p. 143 |
Constructor Helper/private/ctor_ini.m | p. 145 |
Constructor Helper Example/private/ctor_1.m | p. 146 |
Test Drive | p. 147 |
Summary | p. 150 |
Independent Investigations | p. 151 |
Constructing Simple Hierarchies with Inheritance | p. 153 |
Simple Inheritance | p. 154 |
Constructor | p. 154 |
Other Standard Member Functions | p. 157 |
Child Class fieldnames | p. 161 |
Child Class get | p. 162 |
Child Class set | p. 165 |
Parent Slicing in Nonstandard Member Functions | p. 167 |
draw.m | p. 168 |
mtimes.m | p. 168 |
reset.m | p. 169 |
Test Drive | p. 169 |
Summary | p. 173 |
Independent Investigations | p. 174 |
Object Arrays with Inheritance | p. 175 |
When Is a cShape Not a cShape? | p. 175 |
Changes to subsasgn | p. 176 |
Vertcat and horzcat | p. 177 |
Test Drive | p. 178 |
Summary | p. 182 |
Independent Investigations | p. 182 |
Child-Class Members | p. 183 |
Function Redefinition | p. 183 |
/@cStar/private/ctor_ini.m with Private Member Variables | p. 184 |
/@cStar/fieldnames.m with Additional Public Members | p. 184 |
/@cStar/get.m with Additional Public Members | p. 185 |
/@cStar/set.m with Additional Public Members | p. 186 |
/@cStar/draw.m with a Title | p. 187 |
Test Drive | p. 187 |
Summary | p. 189 |
Independent Investigations | p. 190 |
Constructing Simple Hierarchies with Composition | p. 191 |
Composition | p. 191 |
The cLineStyle Class | p. 192 |
cLineStyle's private/ctor_ini | p. 193 |
cLineStyle's fieldnames | p. 194 |
cLineStyle's get | p. 195 |
cLineStyle's set | p. 196 |
cLineStyle's private/ctor_2 | p. 197 |
Using a Primary cShape and a Secondary cLineStyle | p. 198 |
Composition Changes to cShape's ctor_ini.m | p. 199 |
Adding Line Weight to cShape's fieldnames.m | p. 199 |
Composition Changes to cShape's get.m | p. 200 |
Composition Changes to cShape's set.m | p. 201 |
Composition Changes to cShape's draw.m | p. 202 |
Composition Changes to cShape's Other Member Functions | p. 202 |
lest Drive | p. 203 |
Summary | p. 204 |
Independent Investigations | p. 206 |
General Assignment and Mutator Helper Functions | p. 209 |
Helper Function Strategy | p. 209 |
Direct-Link Public Variables | p. 210 |
Get and subsref | p. 210 |
Set and subsasgn | p. 211 |
get and set Helper Functions | p. 212 |
Helper functions, get, and set | p. 212 |
Final template for get.m | p. 213 |
Final Template for set.m | p. 217 |
Color Helper Function | p. 221 |
The Other Classes and Member Functions | p. 222 |
Test Drive | p. 222 |
Summary | p. 223 |
Independent Investigations | p. 224 |
Class Wizard | p. 225 |
File Dependencies | p. 226 |
Data-Entry Dialog Boxes | p. 226 |
Main Class Wizard Dialog | p. 227 |
Header Information Dialog | p. 229 |
Parents...Dialog | p. 231 |
Private Variable...Dialog | p. 232 |
Concealed Variables...Dialog | p. 234 |
Public Variables...Dialog | p. 235 |
Constructors...Dialog | p. 237 |
More...Dialog | p. 238 |
Static Variables...Dialog | p. 239 |
Private Functions...Dialog | p. 240 |
Public Functions...Dialog | p. 242 |
File Menu | p. 243 |
Data Menu | p. 244 |
Build Class Files Button | p. 245 |
Summary | p. 246 |
Independent Investigations | p. 247 |
Class Wizard Versions of the Shape Hierarchy | p. 249 |
cLineStyle Class Wizard Definition Data | p. 249 |
cLineStyle Header Info | p. 250 |
cLineStyle Private Variables | p. 251 |
cLineStyle Public Variables | p. 253 |
cLineStyle Constructor Functions | p. 255 |
cLineStyle Data Dictionary | p. 257 |
cLineStyle Build Class Files | p. 258 |
cLineStyle Accessor and Mutator Helper Functions | p. 259 |
cShape Class Wizard Definition Data | p. 261 |
cShape Header Info | p. 261 |
cShape Private Variables | p. 261 |
cShape Concealed Variables | p. 262 |
cShape Public Variables | p. 263 |
cShape Constructor Functions | p. 264 |
cShape Public Functions | p. 265 |
cShape Data Dictionary | p. 265 |
cShape Build Class Files | p. 266 |
cStar Class Wizard Definition Data | p. 268 |
cStar Parent | p. 268 |
Other cStar Definition Data | p. 269 |
cDiamond Class Wizard Definition Data | p. 271 |
Test Drive | p. 271 |
Summary | p. 272 |
Independent Investigations | p. 275 |
Advanced Strategies | p. 277 |
Composition and a Simple Container Class | p. 279 |
Building Containers | p. 279 |
Container Implementation | p. 280 |
The Standard Framework and the Group of Eight | p. 280 |
Container Modifications to fieldnames | p. 281 |
Container Modifications to subsref | p. 283 |
Container Modifications to subsasgn | p. 285 |
Container Modifications to get | p. 287 |
Container Modifications to set | p. 289 |
Tailoring Built-in Behavior | p. 290 |
Container-Tailored end | p. 291 |
Container-Tailored cat, horzcat, vertcat | p. 291 |
Container-Tailored length, ndims, reshape, and size | p. 293 |
cShapeArray and numel | p. 294 |
Container-Tailored num2cell and mat2cell | p. 295 |
Container Functions That Are Specific to cShape Objects | p. 296 |
cShapeArray times and mtimes | p. 296 |
cShapeArray draw | p. 298 |
cShapeArray reset | p. 299 |
Test Drive | p. 299 |
Summary | p. 302 |
Independent Investigations | p. 302 |
Static Member Data and Singleton Objects | p. 303 |
Adding Static Data to Our Framework | p. 303 |
Hooking Static Data into the Group of Eight | p. 304 |
Static Variables and the Constructor | p. 305 |
Static Variables in get and set | p. 305 |
Static Variables in display | p. 306 |
Overloading loadobj and saveobj | p. 307 |
Counting Assignments | p. 308 |
Singleton Objects | p. 308 |
Test Drive | p. 309 |
Summary | p. 311 |
Independent Investigations | p. 312 |
Pass-by-Reference Emulation | p. 313 |
Assignment without Equal | p. 313 |
Pass-by-Reference Functions | p. 314 |
Pass-by-Reference Draw | p. 315 |
Pass-by-Reference Member Variable: View | p. 316 |
Helpers, get, and subsref with Pass-by-Reference Behavior | p. 316 |
Pass-by-Reference Behavior in the Helper | p. 317 |
Pass-by-Reference Code in get.m | p. 318 |
Pass-by-Reference Code in subsref.m | p. 321 |
Other Group-of-Eight Considerations | p. 321 |
Test Drive | p. 322 |
Summary | p. 324 |
Independent Investigations | p. 324 |
Dot Functions and Functors | p. 327 |
When Dot-Reference Is Not a Reference | p. 327 |
When Array-Reference Is Not a Reference | p. 332 |
Functors | p. 333 |
Functor Handles | p. 334 |
Functor feval | p. 335 |
Additional Remarks Concerning Functors | p. 335 |
Test Drive | p. 336 |
Summary | p. 337 |
Independent Investigations | p. 337 |
Protected Member Variables and Functions | p. 339 |
How Protected Is Different from Other Visibilities | p. 339 |
Class Elements for Protected | p. 339 |
Protected Functions and Advanced Function Handle Techniques | p. 340 |
Passing Protected Handles from Parent to Child | p. 340 |
Accessing and Mutating Protected Variables | p. 341 |
Calling Protected Functions | p. 343 |
Test Drive | p. 344 |
Summary | p. 345 |
Independent Investigations | p. 346 |
Potpourri for $100 | p. 347 |
A Small Assortment of Useful Commands | p. 347 |
Objectdirectory | p. 347 |
Methods and methodsview | p. 347 |
Functions | p. 348 |
Other Functions You Might Want to Overload | p. 348 |
Functions for Built-in Types | p. 348 |
subsindex | p. 349 |
Isfield | p. 349 |
Summary | p. 350 |
Independent Investigations | p. 350 |
Index | p. 351 |
Table of Contents provided by Ingram. All Rights Reserved. |
The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.
The Used, Rental and eBook copies of this book are not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.