Script Function Reference

Function Reference >Script Function Reference >Table Formats>matrix

Matrix

The matrix format is a table representing a matrix.
x.type = "matrix"
x.row -- represents the number of rows
x.col -- represents the number of colums
x[1:row][1:col] -- the elements in the matrix, each element is a number format
Here is an example using the list format.
function getcolumn(matrix, column)
  ret = {}
  ret.type = "list"
  ret.len = matrix.row
  for i = 1,matrix.row do
    ret[i] = matrix[i][column].r
  end
  return ret
end