Table of Contents

Mul

You can multiply matrices with numbers or with other matrices. The latter is implemented as matrix multiplication

Example

Input

Example.Quanty
A = Matrix.New({{1,2},{3,4},{5,6}})
B = Matrix.New({{1,2},{3,4}})
C = A*B
D = 2*B
E = B*2
 
print(C)
print(D)
print(E)

Result

{ {  7      ,  10     } ,
  {  15     ,  22     } ,
  {  23     ,  34     } }
 
{ {  2      ,  4      } ,
  {  6      ,  8      } }
 
{ {  2      ,  4      } ,
  {  6      ,  8      } }

Table of contents