convert decimal to hex with 3 digit
12 ビュー (過去 30 日間)
古いコメントを表示
I just realized that converting -30 to hexadecial by dec2hex(-30) is different from its converting back by hex2dec('E2'). Any suggestion donig right?
dec2hex(-30)
hex2dec('E2')
Also if I want to specify the decimal in signed 12 bit (e.g., 3 hex digital), what am I supposed to do?
0 件のコメント
採用された回答
Chunru
2023 年 12 月 20 日
dec2hex(-30) % this converts to hex in 2's complement
hex2dec('E2') % this treats the hex as unsigned by default
hex2dec('0xE2s8') % s8 to indicate the hex is a signed 8 bit nmber; 0x prefix is also needed
2 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Data Type Conversion についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!