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 Kommentar

Adam
Adam am 3 Mär. 2017
Bearbeitet: Adam am 3 Mär. 2017
What is rb (and siz) and what does 'not working' mean exactly? Error? Incorrect result?

Melden Sie sich an, um zu kommentieren.

 Akzeptierte Antwort

Weitere Antworten (1)

Adam
Adam am 3 Mär. 2017
Bearbeitet: Adam am 3 Mär. 2017

0 Stimmen

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

Kategorien

Community Treasure Hunt

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

Start Hunting!

Translated by