get character value from decimal

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?

请先登录,再进行评论。

更多回答(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

类别

在 帮助中心 和 File 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