Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
documentation:language_reference:objects:matrix:operations:newindex [2024/12/12 14:28] – created Maurits W. Haverkort | documentation:language_reference:objects:matrix:operations:newindex [2024/12/12 15:37] (current) – Maurits W. Haverkort | ||
---|---|---|---|
Line 3: | Line 3: | ||
### | ### | ||
- | alligned paragraph text | + | We can change the value of single elements or rows of a matrix by assigning new values to the indexed elements |
### | ### | ||
===== Example ===== | ===== Example ===== | ||
- | |||
- | ### | ||
- | description text | ||
- | ### | ||
==== Input ==== | ==== Input ==== | ||
<code Quanty Example.Quanty> | <code Quanty Example.Quanty> | ||
- | -- some example code | + | A = Matrix.New({{1, |
+ | print(A) | ||
+ | A[2][2] = 0 | ||
+ | print(A) | ||
+ | A[3] ={7,8} | ||
+ | print(A) | ||
</ | </ | ||
==== Result ==== | ==== Result ==== | ||
<file Quanty_Output> | <file Quanty_Output> | ||
- | text produced as output | + | { { 1 , 2 } , |
+ | { 3 , 4 } , | ||
+ | { 5 , 6 } } | ||
+ | |||
+ | { { 1 , 2 } , | ||
+ | { 3 , 0 } , | ||
+ | { 5 , 6 } } | ||
+ | |||
+ | { { 1 , 2 } , | ||
+ | { 3 , 0 } , | ||
+ | { 7 , 8 } } | ||
</ | </ | ||
===== Table of contents ===== | ===== Table of contents ===== | ||
- | {{indexmenu> | + | {{indexmenu> |