MATLAB: Writing data of different length to Excel

cell arrayexcelxlswrite

Hi I'm trying to write different length of data (all floats) to Excel but can't make it work…
a short example for simplicity:
a = 1:3;
b = 1:4;
and try to write both of them in one-shot to the same spreadsheet. Have tried to use 'num2cell()' without success.
Thanks in advance for the helpers

Best Answer

Did you try xlswrite()?
xlswrite(filename, a, 'A1');
xlswrite(filename, b, 'A2');
With MATLAB version R2015b and later there is virtually no speed penalty doing it in two calls instead of 1.