converting binary to string

조회 수: 14 (최근 30일)
Aravind chockaiaah KANNAN
Aravind chockaiaah KANNAN 2020년 5월 23일
편집: Aravind chockaiaah KANNAN 2020년 5월 25일
hi, im having trouble with finding the string at the end of the code. the error seems to be in the last part. can you please help me resolve it?
stream_n = reshape (msg_error_checked', n, [])';
info_stream = stream_n (:, 1: k);
question = dec2bin (char (info_stream'+ '0' ));
real = '';
%%real = strcat( real,char(bi2de(question,'left-msb')));
  댓글 수: 1
Sanjay Ravichandran
Sanjay Ravichandran 2020년 5월 23일
This is a extension of my question:
https://www.mathworks.com/matlabcentral/answers/531318-converting-binary-characters-into-a-char-error?s_tid=prof_contriblnk

댓글을 달려면 로그인하십시오.

답변 (1개)

Ameer Hamza
Ameer Hamza 2020년 5월 23일
편집: Ameer Hamza 2020년 5월 23일
Something like this?
x = [1 0 0 1 1 1 0 0 1 1];
y = strrep(num2str(x), ' ', '')
Result
y =
'1001110011'
  댓글 수: 2
Aravind chockaiaah KANNAN
Aravind chockaiaah KANNAN 2020년 5월 23일
thanks for the reply. but i cant able to get the binary itself.
Aravind chockaiaah KANNAN
Aravind chockaiaah KANNAN 2020년 5월 23일
i realised that my question was unclear. for additional info.....i have attached a plot, from which i got the values from. i'm trying to use (k,n) = (4,7). but im getting an error saying....... https://www.mathworks.com/matlabcentral/answers/531318-converting-binary-characters-into-a-char-error?s_tid=prof_contriblnk. the same.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by