Table of Contents
Newindex
We can change the value of single elements or rows of a matrix by assigning new values to the indexed elements
Example
Input
- Example.Quanty
A = Matrix.New({{1,2},{3,4},{5,6}}) print(A) A[2][2] = 0 print(A) A[3] ={7,8} print(A)
Result
{ { 1 , 2 } ,
{ 3 , 4 } ,
{ 5 , 6 } }
{ { 1 , 2 } ,
{ 3 , 0 } ,
{ 5 , 6 } }
{ { 1 , 2 } ,
{ 3 , 0 } ,
{ 7 , 8 } }