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

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

 Respuesta aceptada

Toshinobu Shintai
Toshinobu Shintai el 21 de En. de 2022
Editada: Toshinobu Shintai el 21 de En. de 2022

1 voto

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

1 comentario

Lei Ding
Lei Ding el 22 de En. de 2022
ありがとうございます!助かりました🎉

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre データ型の変換 en Centro de ayuda y File Exchange.

Productos

Etiquetas

Preguntada:

el 21 de En. de 2022

Comentada:

el 22 de En. de 2022

Community Treasure Hunt

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

Start Hunting!