8桁のIEEE16進​数表示を10進数に変​換する方法?

以下のように、単精度の数値をhexに変換できるが、逆変換(B⇒Aに変換)の方法はありますか?
A=single(13.17647076);
B = num2hex(A);  ⇒ B = '4152d2d3';

 채택된 답변

Toshinobu Shintai
Toshinobu Shintai 2022년 1월 21일
편집: Toshinobu Shintai 2022년 1월 21일

1 개 추천

'4152d2d3' が単精度浮動小数点数の16進数表示であるとする場合、「typecast」というコマンドで以下のように変換できます。
format long
B = 0x4152d2d3
B = uint32
1095946963
A = typecast(B, 'single')
A = single
13.1764708

댓글 수: 1

Lei Ding
Lei Ding 2022년 1월 22일
ありがとうございます!助かりました🎉

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 データ型の変換에 대해 자세히 알아보기

제품

질문:

2022년 1월 21일

댓글:

2022년 1월 22일

Community Treasure Hunt

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

Start Hunting!