Signed decimal vector to hexadecimal

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 件のコメント

dpb
dpb 2014 年 5 月 21 日
>> sprintf('%x', typecast(int16(-3),'uint16'))
ans =
fffd
>>

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeData Type Conversion についてさらに検索

質問済み:

2014 年 5 月 21 日

コメント済み:

dpb
2014 年 5 月 21 日

Community Treasure Hunt

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

Start Hunting!

Translated by