Filter löschen
Filter löschen

Converting matrix into string

1 Ansicht (letzte 30 Tage)
Vivek Bhadouria
Vivek Bhadouria am 14 Aug. 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.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 14 Aug. 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.

Weitere Antworten (0)

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!

Translated by