Joining Arrays Together - IBM 5110 User Manual

Apl
Table of Contents

Advertisement

JOINING ARRAYS TOGETHER
You can join two arrays to make a single array by using the catenation
or lamination functions. The symbol for these functions is the comma.
Catenation
When catenating vectors, or scalars and vectors, the variables are
joined in the order in which they are specified. For example:
A~··:1.
2
3
I~.
B~··I.I·
I::'
..,
(.)
AlB
1
2
~5
' +
1+
5
6
BIA
1.1·
!;j
6
1
")
&.
~3
L~
AI2
:I.
~.~
.." ,5
' +
~.~
~5
I
A
~5
l. 2
:~
1+
When catenating two matrices or N-rank arrays, the function can take
the form A,[I]B, where I defines the coordinate that will be expanded
when A and B are joined. If the coordinate is not specified, the last
coordinate is used. When A and B are matrices and [I] is [1], the first
coordinate (number of rows) is expanded; when [I] is [2], the last
coordinate (number of columns) is expanded. The following examples
show how to catenate matrices:
Graphic Representation
AlB
10
~;~
0
~30
:1.
:I.
L~
0
~.:;
0 60
L~~
AI [2::tB
:1.0
~2
()
~3
0 1:1.
I.~
0
~.:jO
60
L~
LI.
A,t:::I.::tB
:1.0
20
30
I.~
()
~:;
()
60
:1.1
22 :3:3
1·1·4·
''''t!oo
~)\)
66
22
3~3
~.:;~5
66
22
33
!5~:;
66
B
11
22
33
44
55
66
A
B
20
30
11
22
33
40
50
60
44
55
66
A
10
20
30
40
50
60
B
11
22
33
44
55
66
APL Language Elements
25

Advertisement

Table of Contents
loading

Table of Contents