File Exchange

image thumbnail

Mathieu Functions Toolbox v.1.0

version (309 KB) by E. Cojocaru
elliptical cylinder coordinates, special functions, angular and radial Mathieu functions


Updated 13 Nov 2008

View License

The Mathieu functions are used to solve analytically some problems in elliptical cylinder coordinates. The computational toolbox includes routines for the characteristic values, the expansion coefficients, and the four categories of angular and radial Mathieu functions together with their derivatives: even-even, even-odd, odd-even, and odd-odd. Example files are included. All relations are given explicitly in the documentation file, in pdf format. Tables of numerical values are included in the pdf file. Revisions are specified in the readme file.

Cite As

E. Cojocaru (2021). Mathieu Functions Toolbox v.1.0 (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (10)

Karolina Peckova

Thank you very much. Detailed documentation is really useful.

xiaoyi liao

Thanks you very much for sharing this program. But i feel a little confused about the normalized code in eig_Spm. I think the sum of squares should be 1, rather than sum of the feature vectors

xiaoyi liao


hu yz


I suggest you to use the Scilab toolbox:


Two months and I don't understand this toolbox, if anyone could help me with this


Has anyone been able to use this toolbox? . I tried to get 3D graphics for different values ​​of q and v, unfortunately, I have not achieved

Md Asraful Sekh

i am working on solving diffusion equation in elliptic coordinate involving mathieu equations. i would like to have concentration of diffuse ions inside the elliptic sample which involve roots of radial mathieu function at jita=jita_zero. could anybody help me please how to find out the roots.


I think this toolbox is well done but when i'm using it i don't understand what i get.
If i'm right, when q=0 these functions are simply the harmonic functions, that is, we could use them as DFT eigenfunctions. Nevertheless, i see this is only true if i take only the first term of the expansion series of Mathieu functions. When i take more terms of the expansion i get a completely different result from that of the DFT.

I'd appreciate much if anyone could help me with this issue.
Thank you.

John D'Errico

Pretty good. A useful set of tools, at least if you work with these functions. A few things the author should consider improving.

1. There are no H1 lines. For example, in the help for Ypm, the first two lines of the help are:


Note that the SECOND line of the help was a nice, one line description of the function. It would do very nicely for an H1 line, except it is the SECOND line. Why is an H1 line valuable? Suppose you want to remember the name of this function next year, and your memory is slipping like mine does at times. You might try the lookfor utility. You might type this in MATLAB:

lookfor mathieu

It would return nothing, since the author failed to provide H1 lines for these tools.

Delete that meaningless line of all % symbols, and this code would be more useful.

2. It is a good idea to use mlint on your code. It points out the failure by the author to preallocate some variables, then growing them dynamically in the code. This is inefficient.

3. There are no error checks on the variables. Be friendly to your users. If the argument q must be positive (see the help for Ypm) then test for that property. If this test fails, then return an error that indicates what failed and why. Similarly, if KF can take on only one of the values {1, 2, 3, 4}, then test for that fact. Don't just crap out with some random error, or return a garbage result. Be friendly to those who use your code.

4. Internal comments are valuable, both to those who read your code as well as yourself as the author. Next year when you need to fix a bug in your code, those comments would have been helpful. Learn to comment your code. A great goal to look towards is one line of comment for every line of code. I'll consider you a success if you do half that.

5. The help could be a bit more friendly. For example, Cpm is described as no more than "Correlation factor". Correlation of what?

There were some things I really did like. I found a very useful .pdf file. Well done there. I found examples of the use of these functions, and useful comments in the examples.

I wanted to rate this submission as 3.5 stars. Some might choose to round that up to a 4, others might see those flaws I've pointed out as more important and round it down to a 3. With many misgivings, I've chosen to round this one up to a 4.

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

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!