How to write data in an excel sheet with one separate column for each iteration in a for loop?
8 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposta accettata
Image Analyst
il 24 Nov 2014
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 Commenti
Più risposte (1)
Vedere anche
Categorie
Scopri di più su Spreadsheets in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!