%% Rat-Race Coupler - Visualize and Analyze
% This example shows you how to create, visualize, and analyze a Rat-Race Coupler.
% Create a rat-race coupler with default properties.

ratrace = couplerRatrace

% View the coupler.

show(ratrace)

% Plot the charge distribution at 5 GHz.

charge(ratrace, 5e9)

% Plot the current distribution at 5 GHz.

figure
current(ratrace, 5e9)

% Calculate and plot the s-parameters.

spar = sparameters(ratrace,linspace(1e9,5e9,20))
rfplot(spar)
figure
rfplot(spar,2,1)
hold on
rfplot(spar,3,1)
hold off

% Copyright 2020 The MathWorks, Inc.