Documentation

This is machine translation

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

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

clone

Create copy of existing circuit element or circuit object

Syntax

outelem = clone(inelem)
outckt = clone(inckt)

Description

example

outelem = clone(inelem) creates a circuit element, outelem, with identical properties as inelem. The clone does not copy information about the parent circuit such as ParentNodes and ParentPath.

example

outckt = clone(inckt) creates a circuit object, outckt, identical to inckt. Circuit elements in the inckt are cloned recursively and added to the same nodes in the outckt. The ports or terminals in the outckt are defined same as inckt.

Examples

collapse all

Create a resistor element.

hR1 = resistor(50);
disp (hR1)
  resistor: Resistor element

    Resistance: 50
          Name: 'R'
     Terminals: {'p'  'n'}

Clone resistor hR1.

hR2 = clone(hR1);
disp (hR2)
  resistor: Resistor element

    Resistance: 50
          Name: 'R'
     Terminals: {'p'  'n'}

Create a circuit object. Add a resistor and capacitor to it.

hckt1 = circuit('circuit1');
hC1= add(hckt1,[1 2],capacitor(3e-9));
hR1 = add(hckt1,[2 3],resistor(100));
disp(hckt1)
  circuit: Circuit element

    ElementNames: {'C'  'R'}
           Nodes: [1 2 3]
            Name: 'circuit1'

Clone the circuit object.

hckt2 = clone(hckt1);
disp (hckt2)
  circuit: Circuit element

    ElementNames: {'C'  'R'}
           Nodes: [1 2 3]
            Name: 'circuit1'

Input Arguments

collapse all

Circuit element to be cloned, specified as scalar handle object. The circuit element can be a resistor, capacitor, or inductor.

Circuit object to be cloned, specified as scalar handle object.

Output Arguments

collapse all

Cloned circuit element, returned as scalar handle object. The circuit element can be a resistor, capacitor, or inductor.

Cloned circuit object, returned as scalar handle object.

Introduced in R2013b

Was this topic helpful?