To convert a table into a cell array, you can use the table2cell
function in MATLAB as follows:
161 chars6 lines
This will convert the table T
to a cell array C
, where each row of the cell array corresponds to a row of the table and each column of the cell array corresponds to a variable in the table.
Note that if your table has row names (specified using the RowNames
parameter), the table2cell
function will include them as the first column of the cell array. If you want to exclude the row names, you can use the removevars
function to remove them before calling table2cell
. For example:
299 chars9 lines
This will create a cell array C
without the row names.
gistlibby LogSnag