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

5 次查看(过去 30 天)
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...

采纳的回答

Ken Atwell
Ken Atwell 2012-3-10
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.
  5 个评论
Ken Atwell
Ken Atwell 2012-3-12
Try upper-case "T" in "Text" -- the first message suggests it is upper case and MATLAB is case sensitive.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Structured Data and XML Documents 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by