xlswrite using for loop to increment cells
4 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (1 件)
Arjun Nagendran
2021 年 5 月 24 日
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 件のコメント
参考
カテゴリ
Help Center および File Exchange で Spreadsheets についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!