Signed decimal vector to hexadecimal

4 visualizaciones (últimos 30 días)
Nourhan
Nourhan el 21 de Mayo de 2014
Comentada: dpb el 21 de Mayo de 2014
Hello everyone,
How can I convert signed decimal values into hex? All the functions in Matlab are for unsigned decimal values. I tried to convert the decimal values into 2s complement and then into hex but the values were not the correct.
Anyone could help?
  1 comentario
dpb
dpb el 21 de Mayo de 2014
>> sprintf('%x', typecast(int16(-3),'uint16'))
ans =
fffd
>>

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Data Type Conversion en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by