i GP
Appendix M
WBACIC Program to Calculate Distance Matrices for Cluster
Analysis
00020
00030
00040
00050
00060 OPTION BASE 1
00070 DIM DNEW(12)
00080 DIM YNEW(12)
00090 DIM NNEW(12)
00092 DIM RNEW(12)
00L00 DIM DMTX(12,12)
00110 DIM YMTX(12,12)
00120 DIM RMTX(12,12)
00130 MAT DMTX = (0)
00140 MAT YMTX = (0)
00150 MAT RMTX = (0)
00160
00170 OPEN #4, 'F8SUM10', INPUT
00180 OPEN #10, 'F8DMTX', OUTPUT
00190 OPEN #11, 'F8YMTX', OUTPUT
00200 OPEN #12, 'F8RMTX', OUTPUT
00210
00220 F$ = '@POS(3)Q#.4##4*12"
00222 FFS = ">###4*12"
00230
00240
00250
00260
00270
00280
00290
00300
00310
00320
00330
00340
00350
00360
00370
00372
00374
00380
00386
00400
00410
00420
00430
00440
00450
fOR 2 = 1 TO SS
LINPUT #4, JUNKI1S
INPUT #4 USING F$, MAT YNEW
INPUT #4 USING F$, MAT NNEW
INPUT #4 USING FF$, MAT RNEW
LINPUT #4, JUNK2S
MAT DNEW = YNEW-NNEW
! FILL UP A DISTANCE MATRICES
FOR F = 1 TO 12
FOR G = 1 TO 12
IF F = G THEN GOTO 386
DMTX(F,G) = DMTX(F,G) + ABS(DNEW(F)-DNEW(G))
YMTX(F,G) = YMTX(F,G) + ABS(YNEW(F)-YNEW(G))
IF RNEW(F)=0 THEN GOTO 386
IF RNEW(G)=0 THEN GOTO 386
RMTX(F,G) = RMTX(F,G) + ABS(RNEW(F)-RNEW(G))
NEXT G
NEXT F
NEXT 2