exporting table to specific excel sheet
1 次查看(过去 30 天)
显示 更早的评论
Hi
I want to save several tables into the same xlsx file, but in different sheets
that I can also name (name with meaning instead of sheet1...).
If anyone knows how to do it, that would be great!
Thank you (:
Tali
0 个评论
回答(1 个)
Azzi Abdelmalek
2016-4-14
编辑:Azzi Abdelmalek
2016-4-14
for k=1:3
A=randi(4,4);
xlswrite('file.xlsx',A,sprintf('name%d',k))
end
3 个评论
Walter Roberson
2016-4-14
writetable('file.xlsx', A, 'Sheet', sprintf('name%d',k));
Azzi Abdelmalek
2016-4-14
Convert a table to a cell array
for k=1:3
A=cell2table(num2cell(randi(4,4)));
B=table2cell(A)
xlswrite('file.xlsx',B,sprintf('name%d',k))
end
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!