add
Insert circuit element or circuit object into circuit
Description
Examples
将元素添加到电路
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'
Add Element to Specific Nodes of Circuit
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'
Create and Insert Element in Circuit
创建电路。
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'
Add Two Circuits Together
创建电路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
cktobj
—Circuit object
scalar handle object
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.
cktnodes
—电路节点
向量的强度gers
电路节点of the circuit object, specified as vector of integers. The function uses this input argument to attach the new element to the circuit.
Elem
—电路元素
scalar handle objects
电路元素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.
术语
—元素终端
cell vector
元素端子,这是在终端
property ofElem
。这些输入参数指定为标量句柄对象。。
Output Arguments
elem_out
— Circuit elements
scalar handle objects
使用添加函数后,电路元素作为标量句柄对象返回。该函数使用任何或全部输入参数来创建这些电路元素。
Version History
See Also
Open Example
You have a modified version of this example. Do you want to open this example with your edits?
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select:。
您还可以从以下列表中选择一个网站:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- AméricaLatina(Español)
- Canada(English)
- United States(English)
欧洲
- Belgium(English)
- 丹麦(English)
- Deutschland(德意志)
- España(Español)
- Finland(English)
- 法国(Français)
- 爱尔兰(English)
- 意大利(Italiano)
- Luxembourg(English)
- Netherlands(English)
- 挪威(English)
- Österreich(德意志)
- Portugal(English)
- Sweden(English)
- 瑞士
- 英国(English)