Main Content

clone

Create copy of existing circuit element or circuit object

Description

example

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

example

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

Examples

collapse all

Create a resistor element.

hR1上=电阻器(50);disp (hR1上)
resistor: Resistor element Resistance: 50 Name: 'R' Terminals: {'p' 'n'}

Clone resistorhR1.

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