To convert a cell to a numeric type in Matlab, you can use the cell2mat function. This function concatenates the contents of a cell into a matrix of the same data type. If the cells contain only numerical values, the resulting matrix will be a numeric array.
Here's how to use cell2mat:
main.m209 chars9 lines
The output will be:
main.m28 chars3 lines
Note that if the cells contain non-numeric values, calling cell2mat
will result in an error.
gistlibby LogSnag