Code covered by the BSD License
-
SHCreateVec(lmax)
-
SHCreateYVec(lmax,lon,colat,u...
-
SHDecompose(vec,lmax)
-
SHInfo2Vec(lmcosi)
-
SHInfo2Vec(lmcosi)
-
SHMapToGrid(vec,res,lmax,loca...
-
SHMatrix(vec,lmax)
-
SHMatrix2Vec(A,B)
-
SHPlotProj(vec,res,interp)
-
SHSetValue(invec,value,l,m,N,...
-
SHVec2Info(vec)
lmcosi = SHVec2Info(vec)
-
SHVec2Info(vec)
lmcosi = SHVec2Info(vec)
-
SHVec2Matrix(vec)
-
SHVec2l(vec)
-
SHl2n(l)
-
SHlm2n(l,m)
-
SHn2lm(n)
-
rotvec=SHRotateVec(vec,alp,bt...
rotvec=SHRotateVec(vec,alp,bta,gam)
-
shdemo.m
-
View all files
from
SHtools - Spherical Harmonics Toolbox
by Anna Kelbert
Toolbox for manipulating and plotting vectors of spherical harmonic coefficients
|
| SHCreateVec(lmax)
|
function [vec,istart,iend] = SHCreateVec(lmax)
% [vec,start,end] = SHCreateVec(lmax)
%
% For a given degree lmax, creates an array of zero-valued spherical
% harmonic coefficients. If lmax is a vector of length N, returns a
% concatenated vector of spherical harmonics of degrees lmax(1) .. lmax(N).
% The arrays 'start' and 'end' contain the first and the last indices
% for each of the N sections, so that vec(start(i):end(i)) exactly
% corresponds to the spherical harmonics degree lmax(i).
N = length(lmax);
nmax=zeros(1,N);
istart=zeros(1,N);
vec=[];
for k=1:N
if lmax(k)<0
error('invalid usage: lmax must be a non-negative integer');
end
nmax(k)=SHl2n(lmax(k));
section=zeros(1,nmax(k))';
vec = [vec;section];
end
istart(1)=1;
for k=2:N
istart(k)=istart(k-1)+nmax(k-1);
end
iend = istart+nmax-1;
|
|
Contact us at files@mathworks.com