clone - Create duplicate System object - MATLAB (original) (raw)

Main Content

Create duplicate System object

Syntax

Description

[objClone](#bvleq2a-1-objClone) = clone([obj](#bvleq2a-1-obj)) creates a copy of the System object™obj that has the same property values and states asobj. If the object you clone is in use and you cannot change nontunable properties, the new object is also considered "in use".

example

Examples

collapse all

Copy an Object

Create a Counter object and set a property.

obj = Counter; obj.UseIncrement = false

obj = Counter with properties:

UseIncrement: false
UseWrapValue: true
  StartValue: 1
   Increment: 1
   WrapValue: 10

Clone the object.

obj2 = Counter with properties:

UseIncrement: false
UseWrapValue: true
  StartValue: 1
   Increment: 1
   WrapValue: 10

Input Arguments

collapse all

obj — System object to clone

System object

System object that you want to clone.

Output Arguments

collapse all

objClone — Cloned System object

System object

Copy of the System object that has the same properties and state as the original object.

Version History

Introduced in R2010a