Saving Table in Excel while in loop

조회 수: 2 (최근 30일)
Hashvi Sai
Hashvi Sai 2021년 7월 28일
편집: KSSV 2021년 7월 28일
Hi All
Im running a program pertaining to EEG data. I have a table with one row and while the loop is running i want the output to be saves in excel. i used the following code.
filename = 'testdata.xls'
for n=1:2
AllMI(1:1,:)
writetable(AllMI,'testdata.xls','Sheet',1,'Range', ['A' num2str(n)],'WriteVariableNames',false)
end
the problem is that both the rows are showing the same output.
Please help me with this.

채택된 답변

KSSV
KSSV 2021년 7월 28일
편집: KSSV 2021년 7월 28일
Loop is not needed, you can striaght away write the matrix into excel.
writematrix(AllMI,'test.xlsx');

추가 답변 (0개)

카테고리

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