MATLAB Object-Oriented Programming

(Joyce) #1
Determine If a Class Is Abstract..................... 12-93
Find Inherited Abstract Properties and Methods ......... 12-94

Define an Interface Superclass........................ 12-96
Interfaces ...................................... 12-96
Interface Class Implementing Graphs ................. 12-96

Saving and Loading Objects


13


Save and Load Process for Objects ..................... 13-2
Save and Load Objects ............................. 13-2
What Information Is Saved? ......................... 13-2
How Is the Property Data Loaded?.................... 13-3
Errors During Load ............................... 13-3

Reduce MAT-File Size for Saved Objects................. 13-5
Default Values................................... 13-5
Dependent Properties .............................. 13-5
Transient Properties............................... 13-5
Avoid Saving Unwanted Variables..................... 13-6

Save Object Data to Recreate Graphics Objects ........... 13-7
What to Save.................................... 13-7
Regenerate When Loading.......................... 13-7
Change to a Stairstep Chart ......................... 13-8

Improve Version Compatibility with Default Values....... 13-10
Version Compatibility ............................. 13-10
Using a Default Property Value...................... 13-10

Avoid Property Initialization Order Dependency......... 13-12
Control Property Loading.......................... 13-12
Dependent Property with Private Storage.............. 13-13
Property Value Computed from Other Properties........ 13-14

Modify the Save and Load Process..................... 13-16
When to Modify the Save and Load Process ............ 13-16
How to Modify the Save and Load Process............. 13-16
Implementing saveobj and loadobj Methods............ 13-17

xxiii
Free download pdf