My code generates a cell array with five (5x5) num cells and now I need to export it in a way that each cell of the array will be written in a different sheet of an excel file.
Actually if I use xlswrite, an empty xls file is generated.
I apologize for the silly question but I am a new matlab user and I have not found any useful information in the community
Thanks in advance
Davide

 채택된 답변

KALYAN ACHARJYA
KALYAN ACHARJYA 2020년 12월 15일

0 개 추천

Lets say "cell_data" is cell array
[r c]=size(cell_data);
sheet_num=1;
for i=1:r
for j=1:c
data=cell_data{i,j};
xlswrite('cell_data.xlsx',data,['Sheet',num2str(sheet_num)]);
sheet_num=sheet_num+1;
end
end

댓글 수: 2

Davide Bertelli
Davide Bertelli 2020년 12월 15일
Thank You very much!!!
It works!!
davide
KALYAN ACHARJYA
KALYAN ACHARJYA 2020년 12월 15일
Its my pleasure :)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

제품

릴리스

R2020b

질문:

2020년 12월 15일

댓글:

2020년 12월 15일

Community Treasure Hunt

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

Start Hunting!

Translated by