We can turn matrix objects to strings. This allows one to print matrices. One can however also change the format of the string before printing a matrix
Here we change the curly brackets {,} to straight brackets [,].
A = Matrix.New({{1,2},{3,4}}) AStr = tostring(A) print(AStr) BStr = string.gsub(AStr, "{", "[") BStr = string.gsub(BStr, "}", "]") print(BStr)
{ { 1 , 2 } , { 3 , 4 } } [ [ 1 , 2 ] , [ 3 , 4 ] ]