User guide
15.1.1 areshape
areshapeisamethodforcreatinganarraywithspecifiedcontents.arrayinit
createsanarrayfilledwithaselectedscalarvalue:areshapewilldothesame,but
withamatrix.Forexample,givenamatrix,areshapewillcreateanarraycontaining
multiplecopiesofthatmatrix:
x = reshape(seqa(1, 1, 4), 2, 2);
ord = 3 | 2 | 2;
a = areshape(x, ord);
print a;
Plane [1,.,.]
1.0000 2.0000
3.0000 4.0000
Plane [2,.,.]
1.0000 2.0000
3.0000 4.0000
Plane [3,.,.]
1.0000 2.0000
3.0000 4.0000
Reading Data from the Disk into an Array
areshapeisafastwaytore-dimensionamatrixorarrayalreadyinmemory.For
example,supposewehaveaGAUSSdatasetcontainingpaneldataandthatit'ssmall
enoughtobereadinallatonce:
panel = areshape(loadd("panel"),5|100|10);
mn = amean(panel,2); // 5x1x10 array of means of each panel
mm = moment(panel,0); // 5x10x10 array of moments of each
panel
/*
** vc is a 5x10x10 array of
** covariance matrices
*/
15-2
GAUSSUser Guide










