convertting from char or double to hex ?

11 vues (au cours des 30 derniers jours)
ahmed
ahmed le 3 Avr 2013
Hi, i have a vector which is zeros and ones say A=[1 0 1 0 0 0 1 0] its type is double and i want to convert it to hexadecimal representation i,e the result would be : A2

Réponse acceptée

Walter Roberson
Walter Roberson le 3 Avr 2013
hextable = '0123456789ABCD';
hextable( A(1:4:end) * 8 + A(2:4:end) * 4 + A(3:4:end) * 2 + A(4:4:end) + 1 )

Plus de réponses (1)

ahmed
ahmed le 3 Avr 2013
thanks walter that works pretty good

Catégories

En savoir plus sur Data Type Conversion dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by