MATLAB: Exporting cell arrays with different sizes to excel

cell arrayexport

I have a cell array A with size [1×2], which contains two different arrays [1×4 double] and [1×5 double]. I need to have the different arrays in A in Excel, with the first array on A1 and the second array on A2. However, the only thing I managed to get is to get both arrays behind each other in A1, using B=cell2mat(A), and then xlswrite(filename,B).
How do I get the first array on A1 and the second array on A2?
Thanks in advance!

Best Answer

  • Do this:
    xlswrite(filename,A{1},'1','A1');
    xlswrite(filename,A{2},'1','A2');