How to Save Matrices to excel multiple times with incremental excel name to avoid overwrite
2 views (last 30 days)
let C be a Matrix containing the data from matrix A and B
C = [A(:,i),B(:,i)];
How would i fix xls write such that... it will have 3 Excel file saved...
i.e. C1.xls, C2.xls, C3.xls as i get the data in my "for loop"
because the syntax right now is overwriting C.xls everytime. and I end up with one excel file
Sarah Wait Zaranek on 11 May 2012
The easier way to to construct a new filename within the loop by converting the index to a string and adding it the original name using string concatenation.
Example below ---
for ii = 1:3
filename = ['C' num2str(ii) '.xls'];
% then use filename in xlswrite call