MATLAB: How to get the numeric value from text after parsing an xml file

xml

I use xml2struct to read the xml file into a structure. However, the format of all info are text. For example, attributes z='18' was read in as a text with 1 and 8.
How can I get the numeric 18 and use it for calculation?
Thanks…

Best Answer

I've run into this kind of thing. After calling xml2struct, "walk" the structure and use str2num on anything you want as a numeric instead of text.