Using a loop to write to excel
조회 수: 2 (최근 30일)
이전 댓글 표시
I have a long list of variables in my workspace that I want to write to excel. I am just quoting few here:
List={'B_AfterEmerging','B_Assets1Before','B_Assets2Before','B_Assets3Before'}
I am using the following:
xlswrite('Final.xls',B_AfterEmerging,'BankruptcyData','a2'};
and it is working well. However since I have many sheets and many long lists I thought about writing a loop to export to excel
for i=1:length(List)
xlswrite('Final.xls',eval(sprintf(List{Count{i}})),'BankruptcyData',XX2{Count(i)});
end
I am receiving the following error: Cell contents reference from a non-cell array object.
obviously my second input should be the name of the variable (example B_AfterEmerging) but I am not managing to insert it properly. Any help will be greatly appreciated.
댓글 수: 0
채택된 답변
추가 답변 (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!