フィルターのクリア

converting array of integer to one string (character of arrays)

4 ビュー (過去 30 日間)
Mohamed Jamal
Mohamed Jamal 2020 年 7 月 9 日
コメント済み: Stephen23 2020 年 7 月 10 日
Hi guys, I have an array called binary, it's size 1X3200 double and its values is just 0 or 1 like [1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 .....]
I want to convert this to one string, to array of characters, this means the output is '10101010101010101010101010101010101010 .........' , could anyone help me how can I do that in matlab? I used char=int2str(binary) but the size of char isn't 1X3200 , it's 9598 .. and that's not true .. it must be the same size! any help how do I convert this binary array to chars array? thanks alot!

回答 (1 件)

madhan ravi
madhan ravi 2020 年 7 月 9 日
sprintf('%d',array)
  3 件のコメント
madhan ravi
madhan ravi 2020 年 7 月 9 日
編集済み: madhan ravi 2020 年 7 月 9 日
output = sprintf('%d',array);
whos output % !!!
Stephen23
Stephen23 2020 年 7 月 10 日
"but I need to convert the array a to integer array of numbers to array of chars!!"
Which is exactly what this answer does. Did you try it?

サインインしてコメントする。

カテゴリ

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