Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

loadObjectImpl

Class: matlab.System
Package: matlab

Load System object from MAT file

Syntax

loadObjectImpl(obj,s,wasLocked)

Description

loadObjectImpl(obj,s,wasLocked) implements the code to load a saved System object™ from a structure, s, or from a MAT file. The wasLocked input saves the states if the object is locked. Your loadObjectImpl method should correspond to your saveObjectImpl method to ensure that all saved properties and data are loaded.

    Note:   You must set Access = protected for this method.

Input Arguments

obj

System object

Examples

expand all

Load a saved System object. In this example, the object contains a child object, protected and private properties, and a discrete state. It also saves states if the object is locked and calls the loadObjectImpl method from the matlab.System class.

methods (Access = protected)
  function loadObjectImpl(obj,s,wasLocked)
    obj.child = matlab.System.loadObject(s.child);
    
    obj.protectedprop = s.protectedprop;
    obj.pdependentprop = s.pdependentprop;
    
    if wasLocked
      obj.state = s.state;
    end
    
    loadObjectImpl@matlab.System(obj,s,wasLocked);
  end    
end
Was this topic helpful?