MATLAB怎么实现​浮点数到16进制的转​换(float)。

MATLAB怎么实现浮点数到16进制的转换(float)? 比如10.5我想转换为相应16进制float类型,转换后应该是有4个字节共32位,16位到浮点数转换可以用a = '45438971'b = typecast(uint32(hex2dec(a)),'single')实现,想问下反过来怎么操作?

 채택된 답변

hirocer zhang
hirocer zhang 2023년 3월 30일

0 개 추천

a = '45438971'
b = typecast(uint32(hex2dec(a)),'single')
sprintf('%tx',single(b))

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

태그

질문:

2023년 3월 30일

답변:

2023년 3월 30일

Community Treasure Hunt

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

Start Hunting!

Translated by