## Matlab interface

Once the Matlab interface is built, you must ensure the .m files in
`ssht/src/matlab`

are in your path in order to run the Matlab functions.
A number of Matlab functions and demos illustrating their use are
provided.

#### Functions

Usage of the **SSHT** Matlab interface will most
frequently require only the functions to perform forward and inverse
spherical harmonic transforms (`ssht_forward`

and
`ssht_inverse`

respectively). However, a number of
additional functions are also provided. A full list of Matlab
functions, with brief descriptions are given here:

ssht_c2s Convert cartesian to spherical coordinates ssht_dl Compute Wigner small-d functions ssht_dln Compute Wigner small-d functions for given n ssht_elm2ind Convert harmonic indices to vector index ssht_forward Compute forward spin spherical harmonic transform ssht_forward_adjoint Compute adjoint forward spin spherical harmonic transform ssht_ind2elm Convert vector index to harmonic indices ssht_inverse Compute inverse spin spherical harmonic transform ssht_inverse_adjoint Compute adjoint inverse spin spherical harmonic transform ssht_plot_harmonic Plot spherical harmonic coefficients ssht_plot_mollweide Plot function using Mollweide projection ssht_plot_sphere Plot function on sphere ssht_rotate Rotate a function defined in real space ssht_rotate_flm Rotate a function in harmonic space ssht_s2c Convert spherical to cartesian coordinates ssht_sampling Compute sample positions

To access the documentation for each function in Matlab, simply run:

help <function>

where `<function>`

is the function name.

#### Demos

A number of demos are provided to illustrate the use of the Matlab interface. The demos start extremely simple and progressively become more complicated/flexible.

ssht_demo0 Plot spherical harmonic functions on the sphere. ssht_demo1 Simple demo to compute inverse and forward transform of complex scalar function, using simplest interface with default options. ssht_demo2 Simple demo to compute inverse and forward transform of real scalar function, using simplest interface with default options. ssht_demo3 Demo to compute inverse and forward transform of spin function, using standard interface with various options. ssht_demo4 Demo to compute inverse and forward transform of spin function, using polar interface with various options. ssht_demo5 Simulate a Gaussian cosmic microwave background (CMB). ssht_demo6 Smooth Earth topography map by applying a Gaussian filter in harmonic space. ssht_demo7 Integrate a band-limited function on the sphere using the symmetrised quadrature weights. ssht_demo8 Evaluate Wigner and spherical harmonic functions. ssht_demo_rotation Plot spherical harmonic function on the sphere, then rotate it and plot the rotation.

To access the documentation for each demo in Matlab, simply run:

help <demo>

where `<demo>`

is the demo name.