[next] [previous] [contents]

  7.7.1.3 Multiplication
  You can multiply the elements of two arrays, provided that
  the number of columns in the first array equals the number
  of rows in the second array. The resulting array contains the
  dot product of the two input arrays.
  DIM A(2,2), B(2,2), C(2,2)
  A(1,1) = 1
  A(1,2) = 2
  A(2,1) = 3
  A(2,2) = 4
  B(1,1) = 5
  B(1,2) = 6
  B(2,1) = 7
  B(2,2) = 8
  MAT C = A * B
  MAT PRINT C
    19
    22
    43
    50

  You can also multiply a matrix by a scalar quantity. BASIC
  multiplies each element of the input array by the scalar
  quantity you supply. The output array has the same di-
  mensions as the input array. Enclose the scalar quantity in
  parentheses. The following example multiplies the elements
  of inch_array by the inch-to-centimeter conversion factor
  and places these values in cm_array :
  DIM inch_array(5), cm_array(5)
  MAT READ inch_array
  DATA 1,12,36,100,39.37
  MAT cm_array = (2.54) * inch_array
  MAT PRINT cm_array,
  END

  Output
    2.54 30.48 91.44 254 99.9998