xlswrite会覆盖整个Excel电子表格

时间:2015-08-11 14:20:24

标签: matlab export-to-excel

在Matlab中,我需要生成一个数据单元,这是我以前在运行程序时错过的一个excel文件。不幸的是,当我尝试指定要在xlswrite中写入的单元格并运行程序时,它会删除整个excel电子表格,并且只替换那个生成的单元格。如何在不覆盖整个文件的情况下将一个单元格添加到现有excel文件?

%// data is gathered and stored in predefined variables dice34, HD34, and MAE34. 

%// files specified have already been created and have been added data before.

rangeData = 'A7';

D = {dice34};
H = {HD34};
M = {MAE34};

fileNameD = 'DiceCoefficientReformatted34.xlsx';
fileNameH = 'HausdorffDistanceReformatted34.xlsx';
fileNameM = 'MeanAbsoluteErrorReformatted34.xlsx';

sheet = 'Sheet1';

xlswrite(fileNameD, D, sheet, rangeData);
xlswrite(fileNameH, H, sheet, rangeData);
xlswrite(fileNameM, M, sheet, rangeData);

0 个答案:

没有答案