HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)

4- 80
Table 4-6. Dimensions of Array Function Arguments and Results
---------------------------------------------------------------------------------------------
|||| |
| Array | Dimensions of | Dimensions of | Dimensions of |
| Function |
num_array2
|
num_array3
|
num_array1
(result) |
|||||
---------------------------------------------------------------------------------------------
|||||
| CSUM | (
m,n
) | Not applicable | (
n
)|
|||||
---------------------------------------------------------------------------------------------
|||||
| RSUM | (
m,n
) | Not applicable | (
m
)|
|||||
---------------------------------------------------------------------------------------------
|||||
| TRN | (
m,n
) | Not applicable | (
n,m
)|
|||||
---------------------------------------------------------------------------------------------
|||||
| INV | (
m,m
) | Not applicable | (
m,m
)|
|||||
---------------------------------------------------------------------------------------------
|||||
| MUL | (
m,n
)| (
n,p
)| (
m,p
)|
|||||
---------------------------------------------------------------------------------------------
|||||
| MUL | (
m,n
)| (
n
)| (
m
)|
|||||
---------------------------------------------------------------------------------------------
|||||
| MUL | (
m
)|(
m,p
)| (
p
)|
|||||
---------------------------------------------------------------------------------------------
Examples
10 DIM A(4),B(4),C(4),D(4),E(2,4),F(2)
20 READ (FOR I=1 TO 4,A(I))
30 READ (FOR I=1 TO 2,(FOR J=1 TO 4,E(I,J)))
40 !
50 ! Form 1:
60 MAT B=A !B has the same elements as A, B(1) = A(1), etc
70 !
80 ! Form 2:
90 MAT C=(2+3) !All elements of C have the value of 5
100 !
110 ! Form 3:
120 MAT D=(2)*B ! All elements of D are worth 2 * B, D(1) =20 ,etc
130 MAT D=B*(2) !Alternate form 3b, results are the same as line 61
140 !
150 ! Form 4:
160 MAT C=A+B !Each element, I of C is the total of A(I) + B(I)
170 !
180 ! Form 5:
190 MAT B=CON ! Each element of B is now 1
200 !
210 ! Form 6:
220 MAT D=SQR(A) ! Each element, I of D is now the square root of A(I)
230 !
240 ! Form 7:
250 MAT C=CSUM(E) ! Each element, I of C is now the sum of the entries
260 ! in column I of E
270 !
280 ! Form 8:
290 MAT F=MUL(E,A) ! Array F contains the result of the matrix
300 ! multiplication of E and A
310 !