Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
documentation:language_reference:objects:matrix:operations:div [2024/12/12 14:27] – created Maurits W. Haverkortdocumentation:language_reference:objects:matrix:operations:div [2024/12/12 15:36] (current) Maurits W. Haverkort
Line 3: Line 3:
  
 ### ###
-alligned paragraph text+One can divide a matrix by a number, but also a number by a matrix or a matrix by a matrix. A matrix divided by a number is done element wise. A number divided by a matrix yields the matrix inverse and a matrix divided by a matrix yields the product of the first matrix times the matrix inverse of the second matrix.
 ### ###
  
-===== Example =====+===== Example M / c =====
  
-### +==== Input ==== 
-description text +<code Quanty Example.Quanty> 
-###+A = Matrix.New({{1,2},{3,4}}) 
 +B = A / 2 
 +print(B) 
 +</code> 
 + 
 +==== Result ==== 
 +<file Quanty_Output> 
 +{ {  0.5    ,  1      } , 
 +  {  1.5    ,  2      } } 
 +</file> 
 + 
 + 
 +===== Example c / M =====
  
 ==== Input ==== ==== Input ====
 <code Quanty Example.Quanty> <code Quanty Example.Quanty>
--- some example code+A = Matrix.New({{1,2},{3,4}}) 
 +B = 2 / A 
 +print(B)
 </code> </code>
  
 ==== Result ==== ==== Result ====
 <file Quanty_Output> <file Quanty_Output>
-text produced as output+{ { -4      ,  2      } , 
 +  {  3      , -1      } }
 </file> </file>
 +
 +and
 +
 +==== Input ====
 +<code Quanty Example.Quanty>
 +A = Matrix.New({{1,2},{3,4}})
 +B = 2 / A
 +print(B * A)
 +</code>
 +
 +==== Result ====
 +<file Quanty_Output>
 +{ {  2      ,  0      } ,
 +  {  0      ,  2      } }
 +</file>
 +
 +
 +===== Example M1 / M2 =====
 +
 +==== Input ====
 +<code Quanty Example.Quanty>
 +A = Matrix.New({{1,2},{3,4}})
 +B = Matrix.New({{5,6},{7,8}})
 +C = B / A
 +print(C)
 +</code>
 +
 +==== Result ====
 +<file Quanty_Output>
 +{ { -1      ,  2      } ,
 +  { -2      ,  3      } }
 +</file>
 +
  
 ===== Table of contents ===== ===== Table of contents =====
-{{indexmenu>.#1|msort}}+{{indexmenu>..:#2|tsort}}
  
Print/export