File Exchange

image thumbnail

Phased Array Design Toolbox v2.5

version (8.5 MB) by Neill Tucker
A toolbox allowing rapid definition and evaluation of 2D and 3D phased array antennas.


Updated 18 Sep 2015

View License

This is the abstract from my paper, included as documentation, in the zip file.
Paper Titled : Phased Array Design Toolbox for MATLAB Theory of Operation
In recent years the advances in computer technology has led to increasing use of numerical techniques in the design and development of antennas and related technology. Of particular prevalence are full wave microwave solvers, used to obtain the current densities on and thereby radiated fields for arbitrary structures. However, despite the increases in computer power, array antennas can be electrically very large and therefore still represent a significant analysis problem. As the number of elements in the antenna array increases, its radiated characteristics tend to be dominated by the geometric layout and excitation of the component elements, rather than the elements themselves.
Using simple mathematical models for the element radiation patterns, combined geometrically in the far field, the performance of large arrays can be calculated with reasonable accuracy for significantly less computational effort. A Matlab toolbox has been developed to enable rapid definition and analysis of 2D and 3D antenna arrays, comprising array elements such as dipole, microstrip patch, helix or any user defined element pattern function. This paper documents the theory used in the toolbox.

Cite As

Neill Tucker (2020). Phased Array Design Toolbox v2.5 (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (76)

Syed Akbar

@Jan please read previous questions and response



I get the following error when running ex1.

Calculating 3D Pattern Data : d(Th)=5.00 d(Phi)=15.00
| |
..........................................Error using str2num (line 35)
Input must be a character vector or string scalar.

Error in plot_pattern3d (line 252)

Error in ex1_test (line 30)
plot_pattern3d(5,15,'tot','no'); % Plot a 3D directivity pattern using 5/15 deg theta/phi steps

Lin Sher

I have downloaded .It is very useful.Thanks.

I have question, I'm looking for a code that takes the:
2. The 3 db angles.

Then,it returns the optimal required number of elements and the power ratio from the main lobe to the side lobes. Could you help me with this?



Taiwei Yue

I have simulated a 3x3 patch array using this toolbox. I think this work here is amazing! I have couple of inquiries about the design.
1. Is there a way to use Binomial distribution instead of the default modified Taylor distribution?
2. For a 3x3 patch array (or any kind of array), does this code assume infinitely stretched ground plane? If yes, is there a way to understand how my results would vary once I use finite ground plane. If no, what is the dimension in comparison to the patch array element?

Syed Akbar


Thank you very much for your suggestion. It worked.


Fantastic. Thank you.


@Syed Akbar

"Error using str2num (line 32)
Requires string or character array input."

Change str2num(h) to str2double(h) to fix it.

applies to Matlab R2014 and later

Will Zhu


This is Sricharan. I have designed a phased array antenna using Matlab's Phased array tool box and I have few doubts regarding the same.

1) While simulating an 8X8 array with uniform distrubition, the values obtained for SLL and Power were matching to that of theoritical calculations (say -13dB SLL etc.,).

But, when i make the array larger (say roughly 5000+ elements), my SLL is going down to '-18dB' with the same uniform excitation. Is it a limitation of Toolbox (or) that is the closest value to practical observation? Please explain.

2) I have tried applying Taylor tapering(windowing) to my larger array discussed in the previous problem. Here, I couldn't notice any difference in the max power obtained at the boresight with changing order(nbar) of the taylor window. But, there should be a slight variation as per the theory. Could someone please explain?

Ahad Sheikh



Syed Akbar

Hi, I am running MATLAB R2015b on Windows 10. I am getting the following error when I run of of the examples:

Error using str2num (line 32)
Requires string or character array input.

Error in plot_geopat3d (line 284)

Error in Lband2x2round (line 41)
plot_geopat3d(2,5,'tot','yes','surf',1.8); % Plot a 3D directivity pattern using 5/10 deg theta/phi

It appears there is an issue with the set command set(colorbar,'yticklabel',str2num(h)-dBrange_config) however, i can't seem to find a solution. Please help.

Syed Akbar


Hi there,

Thank you to everyone who has downloaded the toolbox and for the kind words I have received in private e-mails. It seems my little sabbatical in France has come to an end for the moment.

I am happy to continue answering questions regarding the toolbox but now need to also find some paid employment in the field, so any help/contacts in that department would be greatly appreciated.

Kind regards,


e-mail :

Other addresses will still find me for the moment. I will update the documentation when I get a chance.


Hello everyone,

I hope you are enjoying ArrayCalc v2.5. I also hope, no news is good news and there aren't too many problems. If you do have problems or find mistakes, typo's etc, do drop me an e-mail at

Kind regards,


Neill Tucker

Dear Philip,

ArrayCalc as it stands isn't really organised to use multiple interpolated element patterns (as in different patterns for each element). However, I might be able to modify the code to do what you need.

If you are able to send me the data that you are wanting to array and your required array configuration, I'll see what I can sort out.

Kind regards,



Dear Neill,
I wish to import a custom pattern data from a phased array antenna. I have three separate pattern data from three measured ports. Was hoping to find some help on how to mathematically combine the patterns as though it were a 3x1 element design. I've tried to ex3c but not getting the results I require.
Thank you

Neill Tucker

Required products issue corrected. However, please look at the readme.txt file in the ArrayCalc root directory.

Kind regards,


Neill Tucker

Just MATLAB as before, I didn't add them to the list, I can't seem to delete them.

Kind regards,



I'm having case-sensitivity issues too:

Cannot find an exact (case-sensitive) match for 'plot_geom3D'

The closest match is: plot_geom3d in C:\MATLAB\ArrayCalc\Plotting_visualisation\plot_geom3d.m

Error in ex1 (line 25)
plot_geom3D(1,0); % Plot 3D geometry with axis


Dear Ramesh,

Hopefully you got my e-mail reply and everything is working now.

For general information, the most likely cause of this error is that not all the ArrayCalc sub directories have been added to the Matlab search path.

I hope this helps,


Dear Neill
when i run any example like Ex1 im getting the following error
??? Undefined function or method 'design_patchr' for input arguments of type 'double'.
Error in ==> Ex1 at 21
in every example and for validation it gives the same error unidentified function or method of input arguments... though i m trying my level best but can't solve thing problem


what install toolbox

Neill Tucker

I found a problem with statistical variation functions plot_theta_statvar and plot_phi_statvar. The random errors were not being applied to all array elements; note these functions do not affect other calculations. I think a line of code got moved during testing and I forgot to put it back. Apologies for any confusion / inconvenience caused.

The corrections are included in an update v2.4.2, however this is pending approval by an administrator.

If you are wanting to use the statistical variation functions you can download v2.4.2 here :

Dear David,

Thank you for your comments.

Regarding the case sensitivity, I have submitted V2.4.1 with all filenames in lower case but so far it has not appeared on the exchange site. I will have another go today since it does seem to be causing problems on later versions of Matlab.

Regarding the pattern1.mat data, this should be generated from the raw NEC2 data by the previous function :

loadnecpat1('dipole'); on line 20

It could be that Matlab is not able to find the raw data or the format of the .mat files has changed. I've sent you an e-mail with the file attached anyway.

I only have Matlab V6 so it is very hard to track down errors on later versions.

However, do let me know if you have any other problems.

Kind regards,



I did see that program loadnecpat can be used to generate the named file pattern1.mat externally from execution of example program Ex3a. If this is operator error on my part - sorry to have added a comment with out fully investigating the issue.


September 06, 2013. I downloaded this package today and began experimentation . The issues of function name case sensitivity have already been reported and these should not be a major issue for anyone to correct.
When attempting to execute example progrm Ex3A I obtain an error atthe load statement (line23). The program is looking for file pattern1.mat which does not appear in the download file package. Can this file be provided ?


Hey Neill,

I'm not sure why but after I downloaded and moved the files to my MATLAB directory, many of the function names are capitalized such as "INIT.M", so when trying to run the toolbox MatLab cannot find the files. Also when I run functions such as place_element, there are errors (in this case it appears line 119).

Excited to use it though!

Neill Tucker

Hi Changshun,
The change in coordinate system for the rectangular patch is only a transposition of axes : x->Z, y->X and z->Y where x,y,z are the original model and X,Y,Z are those used by ArrayCalc. This means that the same formulas can be used as long as the axes are transposed before the formulas are applied. (Ref patchr.m lines 32-38 in the element models directory).

The reason for the transposition is to ensure the Patch's E-field is aligned with ArrayCalc's X-axis. (See section 4.2 the Theory of operation for why this convention is used).

I hope this helps,


I find your coordinate system definition of the rectangular patch antenna is different from the Balanis's Antenna Theory(Page 743, Figure 14.15), but the formulas are the same(Page 745, formula 14-45/14-46). Can you give some help about this? Thank you.

Neill Tucker

Hi Paul,

Sorry I haven't got back to you sooner, I've e-mailed you directly to clarify exactly what type of acoustic array. Drop me an e-mail if you are still needing the information, I do have some acoustic array examples.

Kind regards,




Although I have been using arrays for a long time, I have not had to design one until now. However, I want to design an acoustic array, not one for radio, and I need to look at the receiver pattern, not the transmission pattern. What do I need to change in order to do this?

A nice array design tool, but it is a little hard to use.

thank you very much neil, i shall be emailing you if am stuck. thanks again

best regards,

Neill Tucker

Dear Chandra,

I'll e-mail you directly as the answer might be a little long for this forum.

Kind regards,


dear neil, am a student from the university of mauritius am am doing a project on EMF safety . my project consist of simulatinf a base station putting all the building around the base station and applying ray tracing method to calculate where the field could be higher than the level allowed by standard..i dont know how to start,can you please help me about how to proceed to input the environment, the antenna characteristic and how to apply ray tracing method in matlab..
i shall be highly obliged to you if you can help me.. thank you

Neill Tucker

For anyone interested in comparisons with practical measurements, this page maybe of interest.


Dear Sam,

It looks like you might have run the rect_array.m file without running init.m first. Rect_array.m fills the array_config matrix and this is initialised in init.m. Check out the example ex2a for a typical application.

Hope this helps,


Sam Hamie

I'm trying to run the rect-array file and I'm unable to! I set the path of the folder and I'm getting the following error :
"Error in ==> rect_array at 67 if array_config(1,1,1)==-1 % If there are no existing elements"

I'm not sure how to solve this problem! I tried to run this and I got another problem!

Please advice,

Neill Tucker

Ooops, interp1.m is already used in Matlab's polyfun m-files. For interp1.m read interpL.m in the last comment.


Neill Tucker

Thank you Binkai and Farah for your kind comments.

After some non-forum correspondence it looks like the problem maybe due to a duplication of the interp.m function.

The interp.m function exists in the Mathworks Signal Processing Toolbox, included as standard on later versions of Matlab.

This problem should be corrected by re-naming ArrayCalc's interp.m function as interp1.m (element_models directory). Also by changing the reference to interp in SUMCODE.m LINE 33 to interp1 (element_indexing directory).

If this proves to be the solution I will upload the modifications.




Thank you for this great toolbox Neill.

I am trying to model the phased array using some of sub arrays. I tried to us the Ex3b file as an example and i also face the same problem as the user above (Binkai). Could you help explain what should be done in order to rectify the situation above?


Neill Tucker

Hello Binkai,

I just found your question.
Is the problem with the original Ex3b file or is it modified in any way?

Is it possible to e-mail me the file that you are trying to run and i will have a look on my machine?

Kind regards,



Hi all,

I am a starter for Phased array calculation, having this toolbox is much convenient and useful for my study.

Recently, I want to import a NEC output pattern for the calculation and I tried the example named 'Ex3b.m' in the 'Examples' folder. And I found it will raise a error while executing the statements as:

place_element(1,0,0,0,0,0,0,'interp',0,0); yrot_array(35,1,1); calc_directivity(10,10);

Then error message from Matlab commander as follows:
Calculating Directivity : d(Th)=10.00 d(Phi)=10.00
| |
...??? Error using ==> interp at 37
Input parameters are out of range.

Error in ==> SUMCODE at 33
case 11,[EleAmp,CPflag]=interp(thloc,philoc);

Error in ==> fieldsum at 100
[EleAmp,CPflag]=sumcode(eltype,thloc,philoc); % Sumcode calls the relevant
element model 'eltype'

Error in ==> calc_directivity at 67
Emultiple=fieldsum(range_config,theta,phi); % E(theta,phi)

Error in ==> Test_Ex3b at 1339
calc_directivity(10,10); % Calc directivity using 10deg
theta and phi steps


If I changed 'interp' to 'user1' or 'patchr' something in function 'place element', the program running successfully without errors.
Therefore, I doubted that there are some mistakes using "interp" function when calculating the directivity. My matlab version is Matlab r2009a (V7.8). Could you comment it and give me some advices about how to solve the problem?

Thank you so much for your kindest attention and help.


Neill Tucker

I found a typo in the plot_geopat3D1 function.

Line 229 is :

Should be : set(fignum,'name',chartname)

Sorry about that,


Neill Tucker

Hi there,

All good questions and some have already crossed my mind.

1. Mutual coupling could be added in a very simplified form by suitably modifying the element excitations. Basically take the 'desired excitation' for each element then add vectorially, an attenuated and phase delayed copy of the excitation to each of its surrounding neighbours. The coupling factor between local elements could be obtained from, a full wave solver, measured, or from empirical data.

I may try to implement some sort of coupling calculation as a specific example but probably not as universal functionality. For some geometrys there may be some benefit, for others it could be rather misleading.

2. The only way I can think of is to use additional low power array elements located at the ground plane edge to represent the diffracted radiation. Deciding exactly what amplitude and phase they should be is a bit more difficult. Have a look at the 'Introduction to Phased Array Design' section on my website, there is a 4NEC2 model of a 6x1 element array on a finite groundplane. Running the 'Array 6-ele' in the Intro Files download you can see edge currents on the groundplane (phase and amplitude).

3. It would certainly be nice to be able to generate script files for HFSS and the like. Unfortunately, full-wave solvers like HFSS need a fair bit more information than is inherent in the ArrayCalc array description. I think there is certainly scope for an automated script generator for full-wave solvers, and ArrayCalc could be a 'start'. My feeling is that it would be better to develop a separate toolbox dedicated to the task. The various array-configuration variables could easily be shared since they are already defined as global.

Overall I feel that ArrayCalc does what it does quite well. The risk of trying to extend it into full-wave solver territory is that you end up caught somewhere between the two, adding lots of complexity for possibly limited benefit.

That said, there is definitely a gap to be filled, you may just have found yourself a project :)



This looks a good start.

1. Any plan to add the calculation of the mutual coupling within the array? Even a simplified calculation can help

2. Is there a way to calculate the dipole array on a finite reflector instead of the infinite ground?

3. Possibility to output the array model to any full-wave analysis software, like HFSS, CST MWStudio?

Neill Tucker

Hi all,

Anyone using the ModTaylor.m function.

The function is returning dB volts not dB power as advertised, the last line of the function should read : dB_POWER=20.*log10(Lin_Volts) not dB_POWER=10.*log10(Lin_Volts);

The dB returned value is only for information (ref exdist.m) and doesn't affect the pattern calculations. It will be corrected in the next update. Thanks to Piro for spotting this typo error.

Also, if you are running later versions of Matlab and are getting lots of warnings, try the 'warning off' command to reduce screen clutter.


Neill Tucker

Hi there,

Just a quick note for anyone planning to build a Phase Array, but on a tight budget. I have put a design for a "Very Low Cost Electro-mechanical Phase Shifter" on the website. It has been tested up to 3Ghz and uses an R/C servo driven directly from a PC's parallel port. The full report and PC software is available for download. Happy constructing.


Neill Tucker

Dear Spandana,

If the toolbox has installed successfully you should be able to run the examples (type 'exlist' to list them all). The example ex1 is for a single rectangular microstrip patch. The example produces a nominal patch design for a given frequency and substrate definition and then calculates/plots directivity and patterns. A complete description of the mathematical model used can be found in the ArrayCalc10d.pdf document under 'Element Mathematical Models'. I hope this helps, but if not, do drop me an e-mail and I'll do my best to get you up and running.

Kind Regards,


Dear Neill,
I am not able to understand as to how to go with the Matlab toolbox.I need to design the radiation pattern and other characteristics of microstrip rectangular patch antenna using matlab coding. please help me out in this regard.

Can you please help me with the design of phased array antenna characteristics?


Does this toolbox work with matlab version 7


Outstanding resource! Very simple to use if documentation is read completely beforehand.

Dear Dan,

Sorry to hear that you have had problems installing the toolbox. The problem as an author is that the exact method of adding paths does appear to vary between Matlab versions.

Thank you for the explanation on the method for 2007b, on my 5.2 version it is necessary to add each folder individually.

Kind Regards,


Dan Kong

I spent three days setting up this toolbox. You should really specify how to install it for the people who do not know how to use matlab.

Brief explanation for antenna experts without practice of matlab: After setting a path (File->Set Path), click on Add with Subfolders (not just 'Add Folder'!!!) and then you can play with all examples

Dan Kong

Hi everybody! Does anybody know why I can't add this Toolbox to the Toolboxes in my Matlab? I'm using 2007b version and I'm not sure if i'm doing it properly.

Shoaib Amin

Dear Neill

thank for ur help , i think i haven;t set all the path to the directory n thank for the help if i faced a problem i'll contact u again


Neill Tucker

Dear Shoaib,

My first question would be to other users : Has anyone else found this problem and the solution to it?

I'm assuming it is not a common problem or the comments list would probably be longer. The only things I can think of are :

Are the MATLAB paths set to all the relevant ArrayCalc sub-directories? Listed in readme.txt in the download.

If you type "help design_patchr" for example does the relevant help file come up? i.e. can MATLAB find the functions.

If these are OK, what version of MATLAB are you running and on what platform?

Sorry not to be of more help at the moment.

Kind Regards,


Shoaib Amin

Dear Neill

when i run any example like Ex1 im getting the following error
??? Undefined function or method 'design_patchr' for input arguments of type 'double'.

Error in ==> Ex1 at 21

in every example and for validation it gives the same error unidentified function or method of input arguments... though i m trying my level best but can't solve thing problem


Dear Shoaib,

No problem, could you be a bit more specific as to the problem?
If it requires a lot of explaining it might be easier via e-mail

Kind regards,


Shoaib Amin

Dear Neill
I am not able to work with the tool box kindly help me out



Seems pretty cool. Cool website too.

Dear Tomas,
What is it you are you are trying to do with the Toolbox?
I may be able to help.
Kind Regards,

P.S. I have put a document 'Introduction to Phased Array Design'
on my website, this may be of interest see link below


HELP, I really dont know, how to start?


References to 'bessel' functions in the taywin_array and related functions changed to besselj. Older versions of Matlab assume bessel is 1st order by default, so didn't flag an error.

References to 'bessel' functions in the taywin_array and related functions changed to besselj. Older versions of Matlab assume bessel is 1st order by default, so didn't flag an error.

Correction to the exspinlin2.m example and the cpol_array.m help info. The cpol_array parameters for generating RHCP/LCHP changed when the phase lead/lag definition was changed for v2.5. The code itself hasn't altered.

Had a few connection problems today, uploaded again to be sure.

A few minor typo's corrected, mainly in the help text of the examples, no changes to the code itself.

Uploaded without toolbox option checked, hopefully to remove the 'required products' that appeared in the previous upload.

Just noticed there were lots of extra required products listed, I didn't add them, still just Matlab itself.

In this update, near-field analysis and calculation of absolute values for gain and radiated field quantities have been added. See the : ‘Change Log’, ‘FAQ’ and ‘What’s new in ArrayCalc v2.5’ in the documentation folder for details.

I found a problem with statistical variation functions plot_theta_statvar and plot_phi_statvar. The random errors were not being applied to all array elements. Apologies for any confusion / inconvenience caused.

All filenames have been changed to lower case, hopefully improving compatibility with later versions of Matlab. There is also additional information on phased array and phase shifter design, as I get many questions on this.

A couple of minor changes to the interp_geom.m file. Some sub-array and reflector modelling examples added

Some new functions added to combine 3D array geometry and 3D patterns on the same plot.
A full user guide is now included.
See changelog.txt for details.

Couple of typo's in help files corrected.

Comments and help added to and tidied up.
Examples moved to separate directory.
Fourier beam synthesis added together with examples, see changelog.txt for details.

Help and comments added to and minor corrections made.
Examples moved to separate directory.
Fourier beam synthesis added, with examples - see changelog.txt

Very minor, place_element.m was reporting angle rather than position in the text commentary to screen (Placing element number... etc). No effect on calculations.

3D Pattern routines re-written, functionally the same but hopefully easier to follow and a bit more robust.see changelog.txt for details.

More examples added illustrating different applications and limits of operation.

General tidying and corrections of help files and comments, rather a lot actually, so apologies for that.

Element excitation error analysis added, see changelog.txt

Circular Polarization analysis added.
Aperture Element models added.
See changelog.txt for details.

Version1.1 is still available at

Some minor corrections, mainly typos in comment/help files.

MATLAB Release Compatibility
Created with R10
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired: 3D spherical equation plot



ArrayCalc/Documentation/Additional Information/Intro to Phased Array Design Files/MATLAB/

ArrayCalc/Documentation/Additional Information/RC Array Files/MATLAB/