Convert ASCII to HEX

14 Ansichten (letzte 30 Tage)
Bakka
Bakka am 31 Jan. 2014
Kommentiert: Bakka am 31 Jan. 2014
Hi everyone, I have character ASCII, exp. pass1234 but I wan't to convert it into HEX, I've tried to convert online through this site http://www.branah.com/ascii-converter . The result is 7061737331323334
But I wan't make program that pass1234 from matlab code,there is edit text box and button to convert it, is there any solutions?please let me know, many thanks

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 31 Jan. 2014
h = uicontrol('Style', 'edit', 'String', 'pass1234');
and later
pass = get(h, 'String');
hexpass = sprintf('%02X', pass+0);
  1 Kommentar
Bakka
Bakka am 31 Jan. 2014
thanks Mr. Walter, finally I got how to convert it.
str='pass1234';
a=sprintf('%X', str);
display(a);

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Environment and Settings finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by