%% Optimizing Linear Dipole Antenna Array
% Open the Antenna Array Designer app. In the Array Gallery section, select the array type as Linear.
% Select Dipole from Antenna Gallery. Select No Backing under the Backing Structure Gallery. Specify the design frequency as 2.4 GHz.  In Layout pane, specify the Number of Elements as 4 and click Accept under the Close section.
%
% Select 3D Pattern under Pattern section to calculate the 3-D radiation pattern.
% The gain is 9.1 dBi. Click Optimize on the app toolstrip to optimize this array.
%
%  On the Optimizer tab, click Maximize Gain in the Objective Function section.  In the Design Variables pane, select the variables you want to optimize. In this example, select the Element Spacing variable and set the lower and upper bounds to 0.06 and 0.09.
%
% Click the Constraints pane. In this example, there are no Constraint Functions. If your application requires constraints, chose one or more constraint functions from the dropdown.
% Click Apply to apply the design variables in this example. In the Settings section, set the number of iterations to 50, select Parallel Computing if you have Parallel Computing Toolbox™, and click Run.
% Once the simulation is complete, the optimization results are displayed in the Results pane
%
%  Click Accept. In the Pattern section, plot the 3D Pattern again. The gain has now increased to 10.7 dBi.
%
%
% Copyright 2019 The MathWorks, Inc.