exporting table to specific excel sheet

조회 수: 1 (최근 30일)
Tali Leibovich
Tali Leibovich 2016년 4월 14일
댓글: Azzi Abdelmalek 2016년 4월 14일
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

답변 (1개)

Azzi Abdelmalek
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
Walter Roberson 2016년 4월 14일
writetable('file.xlsx', A, 'Sheet', sprintf('name%d',k));
Azzi Abdelmalek
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 CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by