MATLAB: Extracting hex numbers from string

exstracting string hex to dec

Hi guys
I have a string like this: 'Address: 0x050 Value: 0xEC'
I am recieving the string from a device, so i cant change the format of the numbers.
I want to extract the hexadecimal numbers from the string and convert them to decimal numbers!
How can i do this?
thx.

Best Answer

s = 'Address: 0x050 Value: 0xEC';
out = sscanf(s,'Address: %x Value: %x');
This includes the conversion from hex to dec.