How to extract a column numerical data as strings?

1 vue (au cours des 30 derniers jours)
Leon
Leon le 7 Avr 2020
Commenté : Leon le 7 Avr 2020
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.

Réponse acceptée

madhan ravi
madhan ravi le 7 Avr 2020
A = string(T.(n)); % have to use string(...) :)
  2 commentaires
KALYAN ACHARJYA
KALYAN ACHARJYA le 7 Avr 2020
yes
Leon
Leon le 7 Avr 2020
Many thanks!
It works flawlessly.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Characters and Strings dans Help Center et File Exchange

Produits


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by