Matrix of bits into ASCII string

조회 수: 6 (최근 30일)
Jan
Jan 2014년 4월 11일
답변: Hacene AYADI 2018년 3월 15일
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