User guide
sig0ind = sig0ind - 1;
W = amult(getarray(theta,thetaind),
atranspose(getarray(E, sig0ind), 2|1));
setarray sigma,sigind, getarray(sigma, sigind)+
amult(W, atranspose(W, 2|1));
loopnextindex thetaloop,thetaind,aord;
sig0ind = sigind;
phiind = 1;
philoop:
sig0ind[1] = sig0ind[1] - 1;
setarray sigma,sigind, getarray(sigma, sigind)+
areshape(amult(amult(getarray(phi, phiind),
getArray(sigma, sig0ind)),
getArray(phi, phiind)), 3|3);
loopnextindex philoop,phiind,gord;
loopnextindex sigloop,sigind,sigord;
Theloopnextindexfunctioninthisexampleisn'tfasterthantheforloopusedin
theprevioussectionprimarilybecausethecodeisloopingonlythroughthefirstdimen-
sionineachloop.Theadvantagesofloopnextindex,previousindex,nex-
tindex,andwalkindexarewhenthecodeisloopingthroughthehigherdimensions
ofahighlydimensionedarray.Inthiscase,loopingthroughanarraycanbeverycom-
plicatedanddifficulttomanageusingforloops.loopnextindexcanbefasterand
moreuseful.
Thenextexamplecomparestwowaysofextractingasubarrayfroma5-dimensional
array:
ord = 3|3|3|3|3;
a = areshape(seqa(1, 1, prodc(ord)) ,ord);
b = eye(3);
for i(1, 3, 1);
15-18
GAUSSUser Guide










