Convert string to a cell, array or matrix
Afficher commentaires plus anciens
Hi everyone,
I was wondering how I could convert an string to array or matrix.
Thanks very much.
Réponse acceptée
Plus de réponses (2)
Titus Edelhofer
le 27 Nov 2015
What about this one:
doc str2num
Titus
1 commentaire
Alfonso Lopez
le 27 Nov 2015
Thorsten
le 27 Nov 2015
A string is a 1Xn matrix of type char
S = 'hallo';
You can convert it to a numerical matrix using
M = double(S);
If that is not what you want, please give us more details, and a sample string.
2 commentaires
Alfonso Lopez
le 27 Nov 2015
Thorsten
le 27 Nov 2015
Please post the data.xlsx file such that we can have a closer look.
Catégories
En savoir plus sur Numeric Types dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!