MATLAB: How to export a Matlab cell array to an Excel spreadsheet

xlswrite

I have a cell array X={'A','B','C','D',A,B,C,D} where A,B,C and D are column vectors of equal size. I intended to create a spreadsheet by: >>xlswrite('X.xls',X) but I didnt get the values of the vectors in my spreadsheet. Maybe I didn't create the cell array properly (when I display the cell array, I get: >> X X =
'A' 'B' 'C' 'D'
{241x1 cell} {241x1 cell} {241x1 cell} {241x1 cell}
Can anyone provide any suggestions? Thanks.

Best Answer

X=[{'A','B','C','D'};A,B,C,D]
xlswrite('X.xls',X)