MATLAB: Do I get an error when I export a large dataset using the EXPORT method of the dataset object from the Statistics Toolbox 7.4 (R2010b)

Statistics and Machine Learning Toolbox

I am getting an error when I am trying to write a large dataset to an Excel file. The code is as follows:
a = rand(90000,1);
DsData = dataset(a);
export(DsData, 'XLSFile', 'Excel_testfile.xls')
??? Error using ==> dataset.export>writeXLSFile/writeXLSVars at 459
Error writing dataset variable 'a' to 'Excel_testfile.xls':
Excel returned: Error: Object returned error code: 0x800A03EC..
Error in ==> dataset.export>writeXLSFile at 453
if mod(j,10) ~= 0, writeXLSVars(); end
Error in ==> dataset.export at 120
writeXLSFile(a,xlsfileArg,writevarnames,writeobsnames,otherArgs{:});

Best Answer

The issue is because of limitations in Excel 2003 in handling data larger than 255 columns and 65536 rows. Excel 2007 can handle larger data, and the following example shows how to write to an Excel 2007 file:
a = rand(90000,1);
DsData = dataset(a);
export(DsData, 'XLSFile', 'Excel_testfile.xlsx')
Related Question