Converting 9 digit number into a string
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Sadia
le 5 Avr 2017
Commenté : MD SAROWER HOSSAIN
le 17 Août 2021
I have a (1675x 1) number matrix. Each numbers are 9 digit number. I want convert this no into string. When I am giving the num2str command it is giving me (1675 x 9) matrix, but I want to get a (1675 x 1) matrix. How can I do that?
3 commentaires
Réponse acceptée
Walter Roberson
le 5 Avr 2017
Result = compose('%d', YourMatrix);
Otherwise you have to use a cell array if you want individual entries. For example,
Result = cellstr( int2str(YourMatrix) );
2 commentaires
Walter Roberson
le 6 Avr 2017
You should be using cell2table() rather than array2table() so that you can combine values of different types.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Data Type Conversion dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!