Saving Table in Excel while in loop

3 次查看(过去 30 天)
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 中查找有关 Data Import from MATLAB 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by