convertting from char or double to hex ?

조회 수: 11 (최근 30일)
ahmed
ahmed 2013년 4월 3일
Hi, i have a vector which is zeros and ones say A=[1 0 1 0 0 0 1 0] its type is double and i want to convert it to hexadecimal representation i,e the result would be : A2

채택된 답변

Walter Roberson
Walter Roberson 2013년 4월 3일
hextable = '0123456789ABCD';
hextable( A(1:4:end) * 8 + A(2:4:end) * 4 + A(3:4:end) * 2 + A(4:4:end) + 1 )

추가 답변 (1개)

ahmed
ahmed 2013년 4월 3일
thanks walter that works pretty good

카테고리

Help CenterFile Exchange에서 Data Type Conversion에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by