What is a difference between a "table" and a matrix?
One can use save command to write a matrix data to a file. Can one use the same save command to write a table to a file?
Best Answer
They're similar but a table can contain different types of data, though all elements in a column must be the same. A matrix/array must have all elements the same, even in different columns, except for acell array which can have different kinds of variables at an element no matter where it is (no requirement that all elements in a column of a cell array contain all the same type of variable like is the case with tables and matrices).
You can use writetable() to write a table to a file.
A matrix must have all the elements of the same data type. Also a table can have different types of data but all the elements in a column must be of the same data type. So you cannot use both of them.
For your case you can create a cell array which can contain elements of various data types.
Best Answer