%% Custom Slot Antenna
% Create a custom slot antenna using three rectangles and a circle. 
%%
% Make three rectangles of 0.5 m x 0.5 m, 0.02 m x 0.4 m and 0.03 m x
% 0.008 m.
pr = em.internal.makerectangle(0.5,0.5);
pr1 = em.internal.makerectangle(0.02,0.4);
pr2 = em.internal.makerectangle(0.03,0.008);
%%
% Make a circle of radius 0.05 m.
ph = em.internal.makecircle(0.05);
%%
% Translate the third rectangle to the X-Y plane using the coordinates [0 
% 0.1 0].
pf = em.internal.translateshape(pr2,[0 0.1 0]);
%%
% Create a custom slot antenna element using the specified boundary shapes.
% Transpose pr, ph, pr1, and pf to make sure the boundary inputs are
% column vector arrays.
c = customAntennaGeometry('Boundary',{pr',ph',pr1',pf'},...
    'Operation','P1-P2-P3+P4');
figure;
show(c);
%%
% Move the feed location to new coordinates.
c.FeedLocation = [0,0.1,0];
c.FeedWidth = 0.008;
figure;
show(c);
%%
% Analyze the impedance of the antenna from 300 MHz to 800 MHz.
figure;
impedance(c, linspace(300e6,800e6,51));
%%
% Analyze the current distribution of the antenna at 575 MHz.
figure;
current(c,575e6)
%%
% Plot the radiation pattern of the antenna at 575 MHz.
figure;
pattern(c,575e6)


%% 
% Copyright 2012 The MathWorks, Inc.