This conversion could be accomplished using CELLFUN in MATLAB. Matrices in MATLAB are however composed of uniform datatype and hence all the cell contents need to be converted to the same data-type.
The CELLFUN function takes each cell of the cell array, applies the function passed in as an argument and stores the output in the corresponding location of a matrix.
Let us consider an example,
C = {single(1),2; NaN, NaN}
The first cell of C contains a single data-type whereas the rest of the cells contain double data-type.
M = cellfun(@(x) double(x), C)
This function converts the contents of each cell of C to a double and stores them in a matrix M.
Best Answer