This is machine translation

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

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

circuit

Circuit object

Description

Use circuit object to build a circuit object which can contain elements like resistor, capacitor, and inductor.

Creation

Syntax

cktobj = circuit
cktobj = circuit(cktname)
cktobj = circuit([elem1,elem2,...])
cktobj = circuit([elem1,elem2,...],cktname)
cktobj = circuit(rfb)
cktobj = circuit(rfb,cktname)

Description

example

cktobj = circuit creates a circuit object cktobj with a default name.

cktobj = circuit(cktname) creates a circuit object cktobj with name of cktname.

example

cktobj = circuit([elem1,elem2,...]) creates a circuit object cktobj by cascading the specified 2-port elements.

cktobj = circuit([elem1,elem2,...],cktname) creates a cascaded circuit object cktobj with the name, cktname.

cktobj = circuit(rfb) creates a circuit object cktobj by cascading the elements in the RF object, rfb.

cktobj = circuit(rfb,cktname) creates a circuit object cktobj by cascading the elements in the RF object, rfb, using name, cktname.

Input Arguments

expand all

2-port RF elements, specified as character vectors. The possible elements are modulator, nport, and amplifier

RF budget object, specified as an object handle.

Properties

expand all

Name of circuit, specified as a character vector. Default name is 'unnamed'. Two circuit elements attached together or belonging to the same circuit cannot have the same name

Data Types: char | string

Name of elements in the circuit, specified as a vector of cell vector. The possible elements here are resistor, capacitor, inductor, and circuit.

Data Types: char | string

Names of terminals in the circuit, specified as a cell vector. Use setterminals or setports function to define the terminals. The terminals of the circuit are only displayed once it is defined.

Data Types: char | string

Names of ports in a circuit specified as a character vector. Use setports function to define the ports. The ports of the circuit are only displayed once it is defined.

Data Types: char | string

List of nodes defined in the circuit, specified as a vector of integers. These nodes are created when a new element is attached to the circuit.

Data Types: double

Full path of parent circuit, specified as a character vector. This path appears only once the child circuit is added to the parent circuit.

Data Types: char | string

Nodes of parent circuit, specified as a vector of integers. This vector of integers is the same length as the Terminals property. This property is read-only and appears only after the child circuit is added to the parent circuit.

Data Types: double

Object Functions

addInsert circuit element or circuit object into circuit
cloneCreate copy of existing circuit element or circuit object
setportsSet ports of circuit object
setterminalsSet terminals of circuit object

Examples

collapse all

Create a circuit called new_circuit. Add a resistor and capacitor to the circuit. Set the terminals and display the results.

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

    ElementNames: {'C'  'R'}
           Nodes: [1 2 3]
            Name: 'new_circuit1'
       Terminals: {'t1'  't2'}

Create a circuit called new_circuit. Add a capacitor and inductor parallel to the circuit.

hckt = circuit('new_circuit');
hC = add(hckt,[1 2],capacitor(1e-12));
hL = add(hckt,[1 2],inductor(1e-9));
disp(hckt)
  circuit: Circuit element

    ElementNames: {'C'  'L'}
           Nodes: [1 2]
            Name: 'new_circuit'

Introduced in R2013b