davyzhu
Advanced Member level 1
matlab dec2hex
Hi all,
I want to convert a vector of dec to hex and sprintf to a string.
The code is:
%%-------------
data=[11 6 18 14];
sprintf('%c ',dec2hex(data))
%%------------
The output is
ans =
0 0 1 0 B 6 2 E
But what I want is "B 6 12 E", why the output of sprintf shuffle the data?
BTW, I use Matlab 5.3.
Any suggestions will be appreciated!
Best regards,
Davy
Hi all,
I want to convert a vector of dec to hex and sprintf to a string.
The code is:
%%-------------
data=[11 6 18 14];
sprintf('%c ',dec2hex(data))
%%------------
The output is
ans =
0 0 1 0 B 6 2 E
But what I want is "B 6 12 E", why the output of sprintf shuffle the data?
BTW, I use Matlab 5.3.
Any suggestions will be appreciated!
Best regards,
Davy