フィルターのクリア

Converting matrix into string

1 回表示 (過去 30 日間)
Vivek Bhadouria
Vivek Bhadouria 2011 年 8 月 14 日
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 Center および File ExchangeData Type Conversion についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by