Note that the values in the right argument are arranged in row order in the arrays. If
the right argument has more than one row, the elements are taken from the right
argument in row order.
The rank of an array is the number of coordinates it has, or the number of indices
required to locate any element within that array. Vectors have a rank of 1, mat-
rices have a rank of 2, and N-rank arrays have a rank from 3 to 63 (where N
is equal
to the rank). N-rank arrays, like matrices, are generated by providing as the left
argument a number indicating the length for each coordinate (planes, rows, and
columns). The following examples show how to generate 3-rank arrays. Note that
the elements taken from the right argument are arranged in row order:
\ 2-plane, %ow, 4-column array
I:: xs
I+ 3 2 ('A
4-plane, 3-row, 2-column array
1: F'
C) P
Finding the Shape of An Array
Once you have generated an array, you can find its shape (number of elements in
each coordinate) by specifying p (shape function) with only a right argument which
is the name of the array. If A is a vector with six elements and you enter pA, the re-
sult is one number because A is a one-dimensional array. The number is 6, the
length (number of elements) of A's one dimension. The result of the shape function
is always a vector:
The shape of a matrix or N-rank array is found the same way:
In some cases, it might be necessary to know just the rank, the number of coordi-
nates (or indices) of an array. The rank can be found by entering pp (shape of the
shape) and a right argument, which is the name of the array:
Previous Page Next Page