Convert cell array to excel - problem with nested cells
More Answers (1)
- write each cell entry as text, perhaps using M2s = cellfun(@mat2str, M2, 'uniform', 0) . If you do that, then Excel will not be able to interpret the results as numeric
- Provided that you do not have any natural "nan" entries, convert each entry into a column and append a nan to it, and combine the entries. You might need to pad each column to the same length using nan. So the first column would contain 52 double, then a nan, then 34 double, then a nan, then 6 nan (longest column would be 92 entries)
- find the widest column and pad each of them out to that size. Then rearrange the entries into continuous columns. Your widest is 74 columns, so you would pad each of the 1 x N out to be 1 x 72, using NaN as your padding; then you would rearrange to a cell containing a letter, then 72 cells with numeric values, then another 72 cells of numeric values, and each column would have that length.
- expand the first column into 52 columns (of 3 rows), expand the second column into 74 columns, the third into 60 columns, and so on, with the number of new colums needed being equal to the widest row in that column. You might need to put in a new row that indicates which original column each entry belonged to.