%% Calculate S-Parameters of Two Capacitors in Circuit
% Create a circuit using default properties.

ckt = circuit;

% Create two interdigital capacitors, one using default properties and one with three fingers.

c1 = interdigitalCapacitor;
c2 = interdigitalCapacitor('NumFingers',3);

% View both c1 and c2.

show(c1)
figure;
show(c2)

% Convert c2 to a PCB element with the Behavioral property set to false.

p = pcbElement(c2,'Behavioral',false);

% Add both capacitors to the circuit object.

add(ckt,[1 2 0 0],c1) % default pcbElement created automatically
add(ckt,[2 3 0 0],p)
setports(ckt,[1 0],[3 0])

% Calculate the S-parameters.

S = sparameters(ckt,8e9) 

% Copyright 2021 The MathWorks, Inc.