Customize load process for objects
b = loadobj(a)
b = loadobj(a) is called by the
load function if the class of
the value loaded from a MAT-file.
loadobj method when objects of the
class require special processing when loaded from MAT-files. If you
saveobj method, then
loadobj method to restore the object to
the desired state.
loadobj as a static method so it can
accept as an argument whatever object or structure that you saved
in the MAT-file.
When loading a subclass object,
only the subclass
loadobj method. If a superclass
loadobj method, the subclass inherits
this method. However, it is possible that the inherited method does
not perform the necessary operations to load the subclass object.
Consider overriding superclass
If any superclass in a class hierarchy defines a
then the subclass
loadobj method must ensure that
the subclass and superclass objects load properly. Ensure proper loading
by calling the superclass
loadobj (or other methods)
from the subclass
The input argument,
b— Object passed to
Object passed to
load function by MATLAB.The value returned by a class
method is typically an object of the class being loaded. However, the
loadobj method can return an object of a different
class or an updated object that matches a new class definition.