hermiteh.m : Hn(x), a hermite polynomial calculator

Returns the value of the nth Hermite polynomial of x.

You are now following this Submission

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 .

Acknowledgements

Inspired by: Hermite polynomials

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
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