Convert Number Character array to Number Integer array/matrix?
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi everyone,
I have a char matrix as follows:
val =
00
01
10
11
I want to convert this cghar matrix to number integer matrix. I tried the str2num command but I obtained this integer matrix:
val =
0
1
10
11
But I want to obtain char matrix as follows:
00
01
10
11
How can I do this? Thanks.
1 commentaire
Rik
le 29 Mar 2023
If you already have the char array and you want to en up with that char array, what exactly is your question?
Réponses (1)
James Tursa
le 29 Mar 2023
Numeric types typically do not get displayed with leading 0's. The numbers you show are converted correctly, they just don't print to the screen with leading 0's.
0 commentaires
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!