Main Content

clone

Create copy of existing circuit element or circuit object

Description

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.

example

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'}
        Elements: [1x2 rf.internal.circuit.RLC]
           Nodes: [1 2 3]
            Name: 'circuit1'

Clone the circuit object.

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

    ElementNames: {'C'  'R'}
        Elements: [1x2 rf.internal.circuit.RLC]
           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.

Version History

Introduced in R2013b