Learn matrix creation, indexing, updates, arithmetic, transpose, determinant and inverse operations in Mewar.
matrix A = [[1,2],[3,4]]
say "Matrix A:"
say A
matrix A = [[1,2],[3,4]]
say "Matrix A:"
say A
show A
matrix A = [[10,20,30],[40,50,60],[70,80,90]]
say "Matrix A:"
show A
newline
# ----- Basic Index Test -----
say "A[1][1] = " + A[1][1]
say "A[2][3] = " + A[2][3]
say "A[3][2] = " + A[3][2]
matrix A = [[1,2,3],[4,5,6],[7,8,9]]
show A
newline
say "Editing A[3][1]"
set A[3][1] to 999
show A
newline
say "Value check:"
say A[3][1]
matrix A = [[1,2],[3,4]]
matrix B = [[5,6],[7,8]]
say "Matrix A:"
show A
newline
say "Matrix B:"
show B
newline
# ----- ADDITION -----
say "A + B:"
set Add to A + B
show Add
newline
# ----- CREATE MATRICES -----
matrix A = [[1,2],[3,4]]
matrix B = [[5,6],[7,8]]
say "Matrix A:"
show A
newline
say "Matrix B:"
show B
newline
# ----- SUBTRACTION -----
say "B - A:"
set Sub to B - A
show Sub
# ----- CREATE MATRICES -----
matrix A = [[1,2],[3,4]]
matrix B = [[5,6],[7,8]]
say "Matrix A:"
show A
newline
say "Matrix B:"
show B
newline
# ----- MULTIPLICATION -----
say "A * B:"
set Mul to A * B
show Mul
# ----- CREATE MATRICES -----
matrix A = [[1,2],[3,4]]
matrix B = [[5,6],[7,8]]
say "Matrix A:"
show A
newline
say "Matrix B:"
show B
newline
# ----- MATRIX FUNCTIONS -----
say "Rows of A = " + rows(A)
say "Columns of A = " + cols(A)
matrix A = [[1,2,3],[4,5,6]]
say "Original Matrix:"
show A
newline
set T to transpose(A)
say "Transpose Matrix:"
show T
matrix A = [[1,2],[3,4]]
say "Matrix A:"
show A
newline
say "det(A) = " + det(A)
matrix A = [[4,7],[2,6]]
show A
newline
set Inv to inverse(A)
show Inv