Matlab writes junk #N/D in Excel file
1 次查看(过去 30 天)
显示 更早的评论
Hi All
I should write an array of 50000x2 from MATLAB to an Excel file, the problem is MATLAB doesn't leave the next rows free and writes something like : #N/D till the line 1 milion !!!
So I should delete it all, but I have so many files
could someone kindly propose a solution ?
2 个评论
dpb
2018-7-23
Would have to see the code that seemed to cause the problem and probably have the data as well.
Are you sure the sheet(s) weren't already that way first?
采纳的回答
OCDER
2018-7-23
编辑:OCDER
2018-7-23
Either specify the exact excel range to write to, or don't specify it at all.
Xsig = rand(10, 2);
xlswrite('test.xlsx', Xsig, 1, sprintf('A1:B%d', size(Xsig, 1)));
OR
Xsig = rand(10, 2);
xlswrite('test.xlsx', Xsig, 1);
When you say write to 'A:B', Matlab has an odd behavior to fill EVERY cell in columns A and B with something. Hence, the 1 million rows of N/A's
4 个评论
OCDER
2018-7-23
xlswrite(name, Xsig, 1, 'A:B');
^ sheet number
You could try
doc xlswrite
help xlswrite
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!