Writing headings AND data with the xlswrite function
1 次查看(过去 30 天)
显示 更早的评论
I have a cell array named NomiDopo containing the names of the columns of my Excel output file and the data (of double) stored in matrix DataSet. If I write
A = {NomiDopo; DataSet}; xlswrite('Guida_1_dopo.xlsx', A);
then the output file does not contain anything. How can I write both the name of the columns and the data in the output file at the same time? Thank you!
0 个评论
回答(1 个)
dpb
2015-5-30
Per the doc for xlswrite, the information written must be "... specified as a two-dimensional numeric or character array, or, if each cell contains a single element, a cell array. If A is a cell array containing something other than a scalar numeric or a string, then xlswrite silently leaves the corresponding cell in the spreadsheet empty."
Your cell array contains an array as a cell element, not an element of the array per cell.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!