How i can convert from hex numbers to charter ?

조회 수: 1 (최근 30일)
Abduellah Elbakoush
Abduellah Elbakoush 2022년 1월 21일
답변: Voss 2022년 1월 21일
I have hexa numbers array like this
'12'
'A6'
'36'
'36'
'F6'
'04'
'EA'
'F6'
'4E'
'36'
'26'
I want to convert to charecter like this
'Hello world'
can anyone help me to solve this problem ?
  댓글 수: 1
DGM
DGM 2022년 1월 21일
C0 = 'Hello world';
H = ['12'; 'A6'; '36'; '36'; 'F6'; '04'; 'EA'; 'F6'; '4E'; '36'; '26'];
C = char(hex2dec(H)).'
C = '¦66öêöN6&'
C-C0
ans = 1×11
-54 65 -54 -54 135 -28 115 135 -36 -54 -62
C = char(hex2dec(fliplr(H))).'
C = '!jcco@®oäcb'
C-C0
ans = 1×11
-39 5 -9 -9 0 32 55 0 114 -9 -2
It's not immediately apparent how these are encoded, or if they're encoded correctly.

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

답변 (1개)

Voss
Voss 2022년 1월 21일
hexStr = ['12';'A6';'36';'36';'F6';'04';'EA';'F6';'4E';'36';'26'];
char(bin2dec(fliplr(dec2bin(hex2dec(hexStr),8)))).'
ans = 'Hello World'

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by