www.gusucode.com > rf 案例源码程序 matlab代码 > rf/PlottingSParametersExample.m

    %% Plotting S-Parameters
% This example shows 
%% Extract and Plot the S-parameters of a File
%

% Copyright 2015 The MathWorks, Inc.

S = sparameters('default.s2p');
disp(S)
rfplot(S)
%% Calculate the S-parameters of a Circuit Object
%
hR1 = resistor(50,'R50');
hckt1 = circuit('example2');
add(hckt1,[1 2],hR1)
setports (hckt1, [1 0],[2 0])
freq = linspace (1e3,2e3,100);
S = sparameters(hckt1,freq,100);
disp(S)
%% Convert Y-parameters to S-parameters
%
Y1 = yparameters('default.s2p');
S1 = sparameters(Y1,100);
disp(Y1)
disp(S1)