matlab.System.loadObjectImpl - Load System object from MAT file - MATLAB (original) (raw)
Main Content
Class: matlab.System
Load System object from MAT file
Syntax
loadObjectImpl(obj,s,wasInUse)
Description
loadObjectImpl([obj](#btlsynn-1%5Fsep%5Fmw%5F353aa417-3412-46f8-81f1-586adf7da5a8),[s](#mw%5F850ababc-839a-493d-86ac-cbe57d566b8c),[wasInUse](#mw%5Fbb8ddd09-5301-49e4-8960-feb3c1bc58c1))
implements the code to load a saved System objectâ„¢ from a structure, s
, or from a MAT file. If the object was in use when saved, the wasInUse
input indicates that in-use state. YourloadObjectImpl
method should correspond to your saveObjectImpl method to ensure that all saved properties and data are loaded.
Run-Time Details
End users can use load
, which calls loadObjectImpl
to load a saved System object into their workspace.
Method Authoring Tips
You must set Access = protected
for this method.
Input Arguments
System object handle used to access properties, states, and methods specific to the object. If your loadObjectImpl
method does not use the object, you can replace this input with ~
.
Saved data returned from saveObjectImpl
.
If the object was in use when saved, the wasInUse
istrue
.
Examples
Load a saved System object. In this example, the object contains:
- A child object
- Protected and private properties
- A discrete state
It also loads states if the object is in use and calls the loadObjectImpl
method.
methods (Access = protected) function loadObjectImpl(obj,s,wasInUse) obj.child = matlab.System.loadObject(s.child);
obj.protectedprop = s.protectedprop;
obj.pdependentprop = s.pdependentprop;
if wasInUse
obj.state = s.state;
end
loadObjectImpl@matlab.System(obj,s,wasInUse);
end
end
Version History
Introduced in R2012b