MATLAB: Sir,i want to convert string into a hexadecimal value…is there any direct command

string to hexadecimal value

sir,i want to convert string into a hexadecimal value…is there any direct command?suppose my string is abc.i want that abc in the hexadecimal value.plz help me sir

Best Answer

Have you tried unicode2native ?
decString = unicode2native('hi','utf-8');
hexString = dec2hex(decString);
You can really select another encoding if you would like and the hexString vector may need to be modified a bit. Otherwise this should work fine. Please comment if this does not solve your problem. If you want the return vector in some special way, then add the wanted output to the question.
Good luck!