IBM 5110 User Manual page 40

Apl
Table of Contents

Advertisement

To count the number of occurrences of each unique character in a
character vector:
'VCOUNT
t::n
J
'V
'Q
Z~C()UN·t'
l,J; UC
[1]
Z~+fWo.=(OAVEW)/OAV
V
COUNT
• f-lBHCCC[lDDDE ·
:1.
2
~~
1+
:l
COUNT
f~BCDBCDCDD
·
:l ...
)
..
'~
~·5
'+
To center the character string in each row of a character matrix:
'VCENTER[[]::tV
'iJ
Zf·CENTEI~
M
t:: 1. ]
Z
i·' ( ....
r (
+ 1/\
\~)
N::::'
')
+
2 ) (I) M
i .. ( ...
1/\ \
M::::
I
' )
qH1
A
A
B
C
'V
c
NATi ..
3 6(.)
I
A
NAT
CENTE
I~
M~~T
c
To right-justify the character string in each row of a character matrix:
VRIGHTJUBTIFY[[]]V
V Zi .. RIGHT .. JUSTIFY M
[:I.]
Zi" ( ....
+/A\
(q>N)::::
I
I
)(~N
V
A
(
"
.,
MAT
RIGHT,JUSTIFY MAT
A
B
C
APL Language Elements
35

Advertisement

Table of Contents
loading

Table of Contents