Code covered by the BSD License  

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Phased Array Design Toolbox v2.5

5.0 | 15 ratings Rate this file 86 Downloads (last 30 days) File Size: 8.5 MB File ID: #22942 Version: 2.5
image thumbnail

Phased Array Design Toolbox v2.5



10 Feb 2009 (Updated )

A toolbox allowing rapid definition and evaluation of 2D and 3D phased array antennas.

| Watch this File

File Information

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.


This file inspired 3 D Spherical Equation Plot.

Required Products MATLAB
MATLAB release MATLAB 5.2 (R10)
MATLAB Search Path
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (62)
11 May 2016 Ahad Sheikh  
21 Jan 2016 Berker

Berker (view profile)


11 Dec 2015 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

Comment only
18 Nov 2015 GUENAD

GUENAD (view profile)

01 Oct 2015 Neill Tucker

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.

Comment only
06 May 2015 thuan

thuan (view profile)

01 Apr 2015 Neill Tucker

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,


Comment only
30 Mar 2015 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,


Comment only
29 Mar 2015 Philip

Philip (view profile)

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

Comment only
14 Mar 2015 Neill Tucker

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

Kind regards,


Comment only
11 Mar 2015 Neill Tucker

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

Kind regards,


Comment only
09 Sep 2014 Gary

Gary (view profile)

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

Comment only
04 Sep 2014 Jenny

Jenny (view profile)

07 Jun 2014 Neill Tucker

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,


Comment only
30 May 2014 Ramesh Patel

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

Comment only
09 May 2014 reza

reza (view profile)

what install toolbox

29 Oct 2013 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 :

Comment only
07 Sep 2013 Neill Tucker

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,


Comment only
06 Sep 2013 David

David (view profile)

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.

Comment only
06 Sep 2013 David

David (view profile)

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 ?

Comment only
10 Jul 2013 Jake

Jake (view profile)

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!

Comment only
06 Mar 2013 Pourya Alinezhad  
16 Jul 2012 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,


Comment only
15 Jul 2012 Changshun Deng

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.

Comment only
31 Mar 2012 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,


Comment only
14 Mar 2012 Paul

Paul (view profile)


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?

Comment only
02 Feb 2012 Changshun Deng

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

27 Aug 2011 Chandrakumar  
27 Aug 2011 Chandrakumar

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

best regards,

Comment only
25 Aug 2011 Neill Tucker

Dear Chandra,

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

Kind regards,


Comment only
25 Aug 2011 Chandrakumar

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

Comment only
23 Aug 2011 Neill Tucker

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


Comment only
05 Jul 2011 Neill Tucker

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,


Comment only
04 Jul 2011 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,

Comment only
20 May 2011 Neill Tucker

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


Comment only
19 May 2011 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.


Comment only
18 May 2011 Farah

Farah (view profile)


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?


10 May 2011 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,


Comment only
06 May 2011 Binkai

Binkai (view profile)

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.


15 Apr 2011 Neill Tucker

I found a typo in the plot_geopat3D1 function.

Line 229 is :

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

Sorry about that,


Comment only
12 Jan 2011 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 :)


Comment only
10 Jan 2011 hai

hai (view profile)

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?

Comment only
19 Nov 2010 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.


Comment only
11 Nov 2010 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.


Comment only
10 Feb 2010 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,


Comment only
09 Feb 2010 spandana spandana

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.

Comment only
09 Feb 2010 spandana spandana

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

Comment only
23 Sep 2009 Sanjay

Sanjay (view profile)

Does this toolbox work with matlab version 7

Comment only
26 Aug 2009 Bill

Bill (view profile)

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

03 Aug 2009 Neill Tucker

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,


Comment only
02 Aug 2009 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

Comment only
01 Aug 2009 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.

Comment only
12 Jun 2009 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


Comment only
11 Jun 2009 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,


Comment only
10 Jun 2009 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


Comment only
09 Jun 2009 Neill Tucker

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,


Comment only
09 Jun 2009 Shoaib Amin

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


Comment only
04 Jun 2009 Mike

Mike (view profile)

Seems pretty cool. Cool website too.

04 Jun 2009 Rebecca Asher  
01 Jun 2009 Neill Tucker

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

Comment only
31 May 2009 Tomas

Tomas (view profile)

HELP, I really dont know, how to start?

Comment only
11 Feb 2009 Diego Barragán

Diego Barragán (view profile)

08 Mar 2009 1.1

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

11 Jun 2009 1.2

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

Version1.1 is still available at

17 Jun 2009 1.5

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

24 Jun 2009 1.6

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.

27 Jun 2009 1.7

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.

11 Jul 2009 1.8

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

12 Jul 2009 1.9

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.

25 Aug 2009 1.10

Couple of typo's in help files corrected.

19 Dec 2010 1.11

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.

02 Jul 2011 1.12

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

09 Sep 2013 1.15

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.

29 Oct 2013 1.18

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.

10 Mar 2015 1.19

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.

11 Mar 2015 1.20

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

14 Mar 2015 1.21

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

31 Mar 2015 1.22

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

31 Mar 2015 1.23

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

12 Apr 2015 1.24

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.

18 Sep 2015 2.5

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.

18 Sep 2015 2.5

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.

Contact us