randomAmplitudesWithSpectrum
initialize with coefficients following a specified spectrum
Declaration
Ap,Am,A0] = randomAmplitudesWithSpectrum(options)
Parameters
A0Spectrum(optional) function_handle with signature @(k,j), defaults to a white spectrum.ApmSpectrum(optional) function_handle with signature @(k,j), defaults to a white spectrum.shouldOnlyRandomizeOrientationsboolean indicating whether randomness in amplitudes should be eliminated (default 0)
Returns
Apmatrix of size [Nj Nkl]Ammatrix of size [Nj Nkl]A0matrix of size [Nj Nkl]
Discussion
This allows you to initialize amplitudes following a spectrum defined in terms of wavenumber and vertical mode.