Converting 9 digit number into a string
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Sadia
am 5 Apr. 2017
Kommentiert: MD SAROWER HOSSAIN
am 17 Aug. 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 Kommentare
Akzeptierte Antwort
Walter Roberson
am 5 Apr. 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 Kommentare
Walter Roberson
am 6 Apr. 2017
You should be using cell2table() rather than array2table() so that you can combine values of different types.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Data Type Conversion finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!