xlswrite using for loop to increment cells
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi,
I have a result to my program, which is 211 matrices of [366 rows * 3 columns] each.
I am trying to write the 211 matrices side by side into excel, but I do not find a way to increment the field "xlRange" in the xlswrite function, because it only takes character values in between ''.
Is there a way to do it?
Thanks
0 Commenti
Risposte (1)
Arjun Nagendran
il 24 Mag 2021
Probably too late, but here's one way to do this.
Create a mapping function as follows:
cell_mapper = @(x,y) strcat(char(64 + x),num2str(y))
Use the mapper to generate your new cell as follows:
mapper(1, 1) = 'A1';
mapper(3, 1) = 'C1';
For explanation, when the above function is evaluated with x = 1, y = 1, the output is:
strcat(char(64 + 1), num2str(1)) = strcat('A', '1') = 'A1'
0 Commenti
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!