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

5 ビュー (過去 30 日間)
J. Hu
J. Hu 2012 年 3 月 10 日
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.
J. Hu
J. Hu 2012 年 3 月 12 日
It works. Thanks...

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeStructured 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