# how to convert table to matrix?

8.554 views (last 30 days)
satya deep on 5 Feb 2018
Commented: Walter Roberson on 16 Dec 2020
for minimization process Boolean function by using binary decision diagram.

Walter Roberson on 5 Feb 2018
table2array() . Or, if the table is all numeric, you can give the table name and then {:, :} such as
mytable{:,:}
##### 2 CommentsShowHide 1 older comment
Walter Roberson on 7 Feb 2018
The code I posted does that. Table objects are always 2 dimensional in MATLAB and for two dimensions the terms array and matrix are the same thing.

FAS on 20 Nov 2018
X = X{:,:}

MathWorks Support Team on 2 Sep 2020
Edited: MathWorks Support Team on 2 Sep 2020
To convert a table to a matrix, use the table2array function. (A matrix is a 2-D array.)
As an alternative, you can convert a table to an array by using the syntax “T{:,:}”, where “T” is the table. This syntax is the equivalent of “table2array”.
All variables in the table must have sizes and data types that allow them to be horizontally concatenated. For example, if all variables in “T” are numeric, then “table2array” returns a numeric array.
##### 2 CommentsShowHide 1 older comment
Walter Roberson on 16 Dec 2020
table2array() converting 0.7 to 1 could happen if the table is mixed data type including at least one integer data type such as uint8 . Please check
unique( varfun(@class, T, 'outputformat', 'cell') )