28.12.2012 Views

Figure Properties - SERC

Figure Properties - SERC

Figure Properties - SERC

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

loadobj<br />

2loadobj<br />

Purpose User-defined extension of the load function for user objects<br />

Syntax b = loadobj(a)<br />

Description b = loadobj(a) extends the load function for user objects. When an object is<br />

loaded from a MAT-file, the load function calls the loadobj method for the<br />

object’s class if it is defined. The loadobj method must have the calling<br />

sequence shown; the input argument a is the object as loaded from the<br />

MAT-file, and the output argument b is the object that the load function will<br />

load into the workspace.<br />

2-1362<br />

These steps describe how an object is loaded from a MAT-file into the<br />

workspace:<br />

1 The load function detects the object a in the MAT-file.<br />

2 The load function looks in the current workspace for an object of the same<br />

class as the object a. If there isn’t an object of the same class in the<br />

workspace, load calls the default constructor, registering an object of that<br />

class in the workspace. The default constructor is the constructor function<br />

called with no input arguments.<br />

3 The load function checks to see if the structure of the object a matches the<br />

structure of the object registered in the workspace. If the objects match, a is<br />

loaded. If the objects don’t match, load converts a to a structure variable.<br />

4 The load function calls the loadobj method for the object’s class if it is<br />

defined. load passes the object a to the loadobj method as an input<br />

argument. Note that the format of the object a is dependent on the results of<br />

step 3 (object or structure). The output argument of loadobj, b, is loaded<br />

into the workspace in place of the object a.<br />

Remarks loadobj can be overloaded only for user objects. load will not call loadobj for<br />

built-in data types (such as double).<br />

loadobj is invoked separately for each object in the MAT-file. The load<br />

function recursively descends cell arrays and structures, applying the loadobj<br />

method to each object encountered.<br />

A child object does not inherit the loadobj method of its parent class. To<br />

implement loadobj for any class, including a class that inherits from a parent,<br />

you must define a loadobj method within that class directory.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!