필터 지우기
필터 지우기

get character value from decimal

조회 수: 14 (최근 30일)
Elysi Cochin
Elysi Cochin 2017년 3월 3일
답변: Walter Roberson 2017년 3월 3일
get character value from decimal
rbi = (dec2bin(rb,1))';
rbin = reshape(rbi,siz,8);
txt = (bin2dec(rbin))';
txt is decimal value needs its character... tried
char(txt) still incorrect result
  댓글 수: 1
Adam
Adam 2017년 3월 3일
편집: Adam 2017년 3월 3일
What is rb (and siz) and what does 'not working' mean exactly? Error? Incorrect result?

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

채택된 답변

Walter Roberson
Walter Roberson 2017년 3월 3일
txt = char( (bin2dec(rbin))' );

추가 답변 (1개)

Adam
Adam 2017년 3월 3일
편집: Adam 2017년 3월 3일
You should use
doc num2str
to convert a number to a string/char. Using direct casting will just give you whatever the Unicode or ASCII value is for your given value

카테고리

Help CenterFile Exchange에서 Data Preprocessing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by