76
The instruction p p B yields the rank (shape of the shape, or, number of coordinates)
of
B:
CAR
BAR
FAR
AI~E
2
2
:1
~5
B~2
2 3p'CARBARFARARE'
B
pH
ppB
Dyadic (Two-Argument) Form:
Reshape
(Structure) A p B
The
reshape
function forms
an
array of the shape specified
by
argument A
using
element(s) from argument
B.
The elements of argument B are placed into the
array
in
row
order.
If
there are not enough elements
in
argument B
to
fill
the
array, the elements are repeated.
If
there are more elements
in
argument B than
are required to
fill
the array, only the required number of elements are used.
Argument A must
be
a nonnegative integer or vector of nonnegative integers. The
number
of
elements
in
argument A
is
equal to the number of coordinates, or the
rank, of the result. Argument B can
be
any variable or constant.
If
all
of the
elements of argument A are nonzero, then B cannot
be
an
empty array:
2
1
2
:3
4·
5 6
4·
2p'ABCDEFGH'
AB
en
EF
GH
5(.)
• MOUSETRAP'
MOUSE
3
l+
p
:l.23
:1.2:3
1.23
123
123
:1.
23
12~5
:1.
2:'~
:I.
:~3
1,23
:1.23
1~~:3
12~5
1 2
3
4-
5 6
'7
B
1.
2 3
I.~
!7i
6
A~~
2p1
2 3
~
5 6 7 8
A
6p·
..
•