convert a matrix into a table
t = matrix2table(m) t = matrix2table(m, Name, Value)
double, boolean, string, datetime or duration matrix
Name: 'VariableNames', Value: vector of strings: the variable name of each column of t. The variable names must be unique and their number must be equal to size(m, 2). Default value: ["Var1", ..., "VarN"].
Name: 'RowNames', Value: vector of string: the row names for t. The names must be unique and their number must be equal to size(m, 1). Default value: [].
table object
matrix2table converts a matrix into a table. The table has the same size of matrix. Each column of m becomes a variable in t.
Like table function, you can specify the variable and row names thanks to optional parameters.
You can use directly t = table(m).
t = matrix2table(m)
m = [1 2 3; 4 5 6; 7 8 9] t = matrix2table(m) // or table(m) m = ["a" "b"; "c" "d"] t = matrix2table(m) | ![]() | ![]() |
t = matrix2table(m, "VariableNames", ["Var1", ..., "VarN"])
m = [1 2 3; 4 5 6; 7 8 9] t = matrix2table(m, "VariableNames", ["c1", "c2", "c3"]) // or table(m, "VariableNames", ["c1", "c2", "c3"]) | ![]() | ![]() |
t = matrix2table(m, "RowNames", val)
Version | Description |
2024.0.0 | Introduction in Scilab. |