How to write data in an excel sheet with one separate column for each iteration in a for loop?
8 ビュー (過去 30 日間)
古いコメントを表示
I have a matlab script that has a for loop for 50 iterations. For each iteration the output is a 4097x1 matrix. I want to write each iteration in a separate sequential column so that at the end I have a 4097x50 matrix in the same excel sheet.
Please note that in the script the output is also getting as one row for all the iterations (that means 204850 rows (4097x50=204850)). If I can get all the results in a matrix form 4097x50 in matlab that also will do the purpose.
Can anyone please help me on this??
Thank You.........!!!!
0 件のコメント
採用された回答
Image Analyst
2014 年 11 月 24 日
output = zeros(4097, 50); % Preallocate
for iteration = 1 : 50
output(:, iteration) = GetColumnVector(); % Stuff your 4097 elements into one column.
end
xlswrite(filename, output, 'A1');
2 件のコメント
その他の回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Spreadsheets についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!