Convert [4,5] to D5 for excel write

5 ビュー (過去 30 日間)
Meaghan
Meaghan 2013 年 6 月 3 日
Hi,
I have a loop that continuously generates data that gets written one at a time. Problem is that the cell that gets called is named as a spot in a matrix ie 4,5. In order to excel write i need to say D5.
Any ideas?
Thanks

採用された回答

Walter Roberson
Walter Roberson 2013 年 6 月 3 日
Convert to base 26, add 1 to each digit, and use the result to index 'A':'Z' to find the characters.

その他の回答 (2 件)

Meaghan
Meaghan 2013 年 6 月 3 日
Thanks! I got it to convert a letter, now I have the column and row as two different variables and need to combine them as one. Any further suggestions?

Iain
Iain 2013 年 6 月 3 日
coordinate = ['A'-1+wanted_col num2str(wanted_row)];
It only works for up to "Z".
  1 件のコメント
Meaghan
Meaghan 2013 年 6 月 3 日
Thank you!

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by