Effacer les filtres
Effacer les filtres

Converting matrix into string

1 vue (au cours des 30 derniers jours)
Vivek Bhadouria
Vivek Bhadouria le 14 Août 2011
Hello everyone,
I am having a matrix of dimension [20*11] as [0 0 0 0 0 0 0 0 0 1 0;1 0 0 0 0 0 0 0 0 0 0;............] and I am trying to convert this matrix as string in the dimension [20*1] as [00000000010;10000000000;............]. Please help me how to do this.

Réponse acceptée

Walter Roberson
Walter Roberson le 14 Août 2011
You cannot do that. Strings are inherently arrays of characters, so the string 'ABC' does not have dimension 1 x 1, it has dimension 1 x 3.
What you can do, if your matrix is named X (for example) is
char(X + '0')
That will create a 20 x 11 character matrix with the first row '00000000010' and so on.

Plus de réponses (0)

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!

Translated by