Create duplicate System object
objCloned = cloneImpl(obj)
specifies the algorithm that creates a duplicate of the System object™
objCloned = cloneImpl(
obj. When you duplicate a System object the in-use status of the original object is inherited by the cloned object. Use
to check if a System object is in use.
cloneImpl is not defined the
clone method creates a
System object with same property and states as the original object.
cloneImpl is called by the
Method Authoring Tips
You must set
Access = protectedfor this method.
In this method, cannot modify any properties of the original object.
Use this method to change the properties of an unlocked System object or change the states of a locked System object while duplicating.
obj — System object
System object handle used to access properties, states, and methods specific to the
object. If your
cloneImpl method does not use the object, you can
replace this input with
objCloned — System object
Copy of the System object according to method specifications.
Clone a System object with specified state
Specify in your class definition file that the System object state
power is set to a desired value when the object
is duplicated while it is in use.
methods (Access = protected) function objCloned = cloneImpl(obj) if isLocked(obj) objCloned = obj; objCloned.power = 1; else objCloned = obj; end end end
Introduced in R2012b