export data of a loop in different excel files
조회 수: 2 (최근 30일)
이전 댓글 표시
Hello all-- Well it seems i face with a new problem. :-(
How can I export the data corresponding to each filenumber in my code to a different excel file?
for k = 1:10
filename = sprintf('%d.txt',k);
A = load(filename);
% doing some calculations
import output as k.xlsx
end
Well my desired outputs are 10 excel files whose names are 1.xlsx,2.xlsx and etc. Thank you so much
댓글 수: 0
채택된 답변
Stephen23
2015년 8월 27일
편집: Stephen23
2015년 8월 27일
Try reading the documentation for xlswrite, and thinking about how you could adapt the code that I gave you earlier:
for k = 1:10
...
newfilename = sprintf('%d.xls',k);
xlswrite(newfilename,output)
end
Note that there are many options for xlswrite, so please read the documentation carefully.
댓글 수: 2
추가 답변 (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!