主要内容

add

Insert circuit element or circuit object into circuit

Description

example

添加(cktobj,cktnodes,Elem)插入电路元件Elem进入电路对象cktobj。The terminals of theElem连接到指定的节点cktnodes。IfElemis a Touchstone file name or s-parameters object, annportobject is created from input and added tocktobj

example

添加(cktobj,cktnodes,Elem,术语)the terminals specified in术语are attached to circuit nodes specified incktnodes

example

elem_out= add(_____)returns the inserted circuit elementelem_outas an output. Specify any of the input argument combinations in the previous syntaxes.

Examples

collapse all

Create a resistor, and add it to a circuit.

HR1 =电阻(50);hckt1 =电路('new_circuit1');添加(hckt1,[1 2],hR1) disp(hR1)
resistor: Resistor element Resistance: 50 Name: 'R' Terminals: {'p' 'n'} ParentNodes: [1 2] ParentPath: 'new_circuit1'
disp(hckt1)
电路:电路元素名称:{'r'}元素:[1x1电阻]节点:[1 2]名称:'new_circuit1'

Create a capacitor.

HC2 =电容器(1E-10)
hC2 = capacitor: Capacitor element Capacitance: 1.0000e-10 Name: 'C' Terminals: {'p' 'n'}
disp(hC2)
capacitor: Capacitor element Capacitance: 1.0000e-10 Name: 'C' Terminals: {'p' 'n'}

Connect terminalnof the capacitor to node 3 and terminalpof the capacitor to node 4.

hckt2 = circuit('new_circuit2');添加(hckt2,[3 4],hC2,{'n''p'}) disp (hckt2)
电路:电路元素名称:{'c'}元素:[1x1电容器]节点:[3 4]名称:'new_circuit2'

创建电路。

hckt3 = circuit('new_circuit3')
hckt3 = circuit: Circuit element ElementNames: {} Nodes: [] Name: 'new_circuit3'

Insert an inductor into the circuit using the add function.

hL3 = add(hckt3,[100 200],inductor(1e-9));

Display the circuit element.

disp(hckt3)
circuit: Circuit element ElementNames: {'L'} Elements: [1x1 inductor] Nodes: [100 200] Name: 'new_circuit3'

显示插入的电路元件。

disp(hL3)
电感器:电感器元素电感:1.0000E-09名称:'l'终端:{'p''n'} parentnodes:[100 200] parentpath:'new_circuit3'

创建电路1并使用setterminals功能。

hckt1 =电路('电路_new1');添加(HCKT1,[1 2],电阻(100));set端(HCKT1,[1 2]);disp(hckt1);
circuit: Circuit element ElementNames: {'R'} Elements: [1x1 resistor] Nodes: [1 2] Name: 'circuit_new1' Terminals: {'t1' 't2'}

创建电路2并设置端子。

hckt2 = circuit('电路_new2');添加(hckt2, [3 4], capacitor(1.5e-9)); setterminals(hckt2, [3 4]); disp(hckt2);
电路:电路元素名称:{'c'}元素:[1x1电容器]节点:[3 4]名称:'courtile_new2'终端:{'t1''t2'}

Add the two circuits.

添加(hckt1, [2 4], hckt2); disp(hckt2)
电路:电路元素名称:{'c'}元素:[1x1电容器]节点:[3 4]名称:'courtile_new2'终端:{'t1''t2'}ParentNodes: [2 4] ParentPath: 'circuit_new1'
disp(hckt1)
circuit: Circuit element ElementNames: {'R' 'circuit_new2'} Elements: [1x2 rf.internal.circuit.Element] Nodes: [1 2 4] Name: 'circuit_new1' Terminals: {'t1' 't2'}

Input Arguments

collapse all

Circuit object into which the circuit element is inserted, specified as scalar handle object. This circuit object can be a new circuit or a nport object, or an already existing circuit.

电路节点of the circuit object, specified as vector of integers. The function uses this input argument to attach the new element to the circuit.

电路元素that are inserted into the circuit object, specified as scalar handle objects. The element can be a resistor, capacitor, inductor, Touchstone file name, s-parameter object, or an entire circuit.

元素端子,这是在终端property ofElem。这些输入参数指定为标量句柄对象。。

Output Arguments

collapse all

使用添加函数后,电路元素作为标量句柄对象返回。该函数使用任何或全部输入参数来创建这些电路元素。

Version History

在R2013B中引入