xlswrite using for loop to increment cells
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (1)
Arjun Nagendran
am 24 Mai 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 Kommentare
Siehe auch
Kategorien
Mehr zu Spreadsheets finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!