You can use the # operator to get the number of rows and columns of a matrix
A = Matrix.New({{1,2},{3,4},{5,6}}) print("number of rows in A = ",#A) print("number of cols in A = ",#A[1])
number of rows in A = 3 number of cols in A = 2