Converting matrix into string

1 次查看(过去 30 天)
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.

采纳的回答

Walter Roberson
Walter Roberson 2011-8-14
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.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Type Conversion 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by