Effacer les filtres
Effacer les filtres

get character value from decimal

14 vues (au cours des 30 derniers jours)
Elysi Cochin
Elysi Cochin le 3 Mar 2017
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 commentaire
Adam
Adam le 3 Mar 2017
Modifié(e) : Adam le 3 Mar 2017
What is rb (and siz) and what does 'not working' mean exactly? Error? Incorrect result?

Connectez-vous pour commenter.

Réponse acceptée

Walter Roberson
Walter Roberson le 3 Mar 2017
txt = char( (bin2dec(rbin))' );

Plus de réponses (1)

Adam
Adam le 3 Mar 2017
Modifié(e) : Adam le 3 Mar 2017
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

Catégories

En savoir plus sur Data Preprocessing dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by