export values to specific cell in excell
1 次查看(过去 30 天)
显示 更早的评论
hello, i want to creat a column in excell from values i get from matlab. example:
for i:1:10
x=i;
xlswrite(data,x);
end
to get in excell- [1 2 3 4 5 6 7 8 9 10]
but it always write only the last value- [10]
0 个评论
回答(2 个)
Sulaymon Eshkabilov
2022-8-17
Do not use a loop operation that is not efficient and xlswrite(). Use the following syntax:
writematrix((1:10).', 'MY_Data.xlsx');
Sulaymon Eshkabilov
2022-8-17
Then you may need to use this syntax:
Data = [];
for ii = 1:13
N = ii;
Data = [Data; {N}]; % Accumulate all data in a single cell array
end
writecell(Data, 'MY_data1.xls')
winopen('MY_data1.xls')
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!