Matrix of bits into ASCII string

6 次查看(过去 30 天)
Hi. I have a problem. I have matrix of bits ([0 1 1 1 0 1 1 1 ...], every column is 1 bit) where every 8 bits are one char. I need to convert matrix into ASCII string. How can i do that?
  2 个评论
Azzi Abdelmalek
Azzi Abdelmalek 2014-4-11
What is the result if
a=[ 1 0 0 1 0 1 0 1 1 0 0 0 1 1 1 1]
Jan
Jan 2014-4-11
I used
dec2bin(word,8)
so the first bit of group of eight is always 0. In fact i could use only 7 bits... OK so how can i convert matrix into ASCII string where every 7 bits are one char?

请先登录,再进行评论。

采纳的回答

Walter Roberson
Walter Roberson 2014-4-11
char(bin2dec(reshape(char('0' + YourVector),BitsPerCharacter,[]).'))

更多回答(1 个)

Hacene AYADI
Hacene AYADI 2018-3-15
@Walter Roberson plz i have matrix of binary and i want to convert to char my matrix of 64bis and size(2,94) i need help and thx

类别

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