Documentation Center

  • Trial Software
  • Product Updates

cloneImpl

Class: matlab.System
Package: matlab

Copy System object

Syntax

cloneImpl(obj)

Description

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

obj

System object handle of object to clone.

Examples

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);
   end
end

See Also

|

How To

Was this topic helpful?