How to extract a column numerical data as strings?

1 回表示 (過去 30 日間)
Leon
Leon 2020 年 4 月 7 日
コメント済み: Leon 2020 年 4 月 7 日
I have some data stored in xlsx format. There is always a column data called "Station IDs". Sometimes it is numerical and sometimes it is strings. I'm using readtable to read the xlsx file.
T=readtable('test.xlsx');
My program can automaticall identifically the column numer (n). I can get the whole column of data as:
A = T.(n);
Here is my question. How do I get the column values as strings no matter it is originally numerical or strings.
Thanks.

採用された回答

madhan ravi
madhan ravi 2020 年 4 月 7 日
A = string(T.(n)); % have to use string(...) :)
  2 件のコメント
KALYAN ACHARJYA
KALYAN ACHARJYA 2020 年 4 月 7 日
yes
Leon
Leon 2020 年 4 月 7 日
Many thanks!
It works flawlessly.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by