%% Circular Array of Dipoles
% Define the radius and the number of elements for the array.

r = 2;
N = 12;

%
% Create an array of 12 dipoles.

elem = repmat(dipole('Length',1.5),1,N);

%
% Define the x,y,z values for the element positions in the array.

del_th = 360/N;
th = del_th:del_th:360;
x = r.*cosd(th);
y = r.*sind(th);
z = ones(1,N);
pos = [x;y;z];

%
% Create a circular array using the defined dipoles and then visualize it. Display the layout of the array.

c = conformalArray('Element',elem,'ElementPosition',pos');
show(c)
figure
layout(c)

%
% Change the width of the fourth and the twelfth element of the circular array. Visualize the new arrangement.

c.Element(4).Width = 0.05;
c.Element(12).Width = 0.2;
figure
show(c)

%
% Calculate and plot the impedance of the circular array at 100 MHz. The plot shows the impedance of the first element in the array.

figure
impedance(c,100e6)

% To view the impedance of all the elements in the array change the value from 1 to 1:12 as shown in the figure.
%
% Copyright 2012 The MathWorks, Inc.