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

Version 1.3.0.0 (740 Bytes) by Shawn Divitt
Returns the value of the nth Hermite polynomial of x.
716 Downloads
Updated 3 Nov 2014

View License

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
Created with R2012b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Polynomials in Help Center and MATLAB Answers
Acknowledgements

Inspired by: Hermite polynomials

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