Class: matlab.System
Package: matlab

Copy System object




cloneImpl(obj) copies a System object™ by using the saveObjectImpl and loadObjectImpl methods. The default cloneImpl copies an object and its current state but does not copy any private or protected properties. If the object you clone is locked and you use the default cloneImpl, the new object will also be locked. If you define your own cloneImpl and the associated saveObjectImpl and loadObjectImpl, you can specify whether to clone the object's state and whether to clone the object's private and protected properties.

cloneImpl is called by the clone method.

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

    You cannot modify any properties in this method.

Input Arguments


System object handle of object to clone.


expand all

Clone a System Object

Use the cloneImpl method in your class definition file to copy a System object

methods (Access = protected)
   function obj2 = cloneImpl(obj1)
      s = saveObject (obj1);
      obj2 = loadObject(s);
Was this topic helpful?