hermiteh.m : Hn(x), a hermite polynomial calculator
This function returns the value of the nth Hermite polynomial of x. It is defined in terms of the "physicists" Hermite polynomials (see Wikipedia).
Syntax: val = hermiteh(n,x);
Where "n" is the order of the polynomial and "x" is the argument. "x" can be a scalar or an array with up to two dimensions.
Also included is an example script to show one possible use. The image displayed with this file is of the Hermite-Gaussian 3,3 mode and uses hermiteh.m to create it.
This function is expected to be a bit faster for high orders than the submission acknowledged below because it uses the explicit formula and not the recursion relation.
Cite As
Shawn Divitt (2026). hermiteh.m : Hn(x), a hermite polynomial calculator (https://www.mathworks.com/matlabcentral/fileexchange/47725-hermiteh-m-hn-x-a-hermite-polynomial-calculator), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- MATLAB > Mathematics > Elementary Math > Polynomials >
Tags
Acknowledgements
Inspired by: Hermite polynomials
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.3.0.0 | The example script was missing a sqrt(2) scaling factor and as a result gave the wrong distribution for the Hermite-Gaussian modes. This change does not affect the calculator itself. Updated to the correct picture of the Hermite-Gaussian 3,3 mode. |
||
| 1.2.0.0 | updated title |
||
| 1.1.0.0 | rev. 1 - added an example script and an image |
||
| 1.0.0.0 |
