How to deal with a nestled struct
古いコメントを表示
Hi,
I have a xlm I wish to study. I used this code:
clc; clear all; close all
sampleXMLfile = 'A_AXIS_1.xml';
xDoc=parseXML(sampleXMLfile);
I need to manage data starting from line 87:

Browsing the struct i can find the data here
xDoc(2).Children(10).Children(2).Children(12).Attributes
Here i can find rec time, f1, f2 and f3 as Attributes.
How can i transfer them in a matrix so i can manipulate them?
6 件のコメント
Walter Roberson
2020 年 7 月 30 日
Could you post a sample file for us to test with?
andrea vironda
2020 年 7 月 30 日
Walter Roberson
2020 年 7 月 30 日
There are thousands of broken records in the file. For example,
<rec time="5.842000" f1="-0.229889" f2="0.000671" f3="359.989757"/>
<rec time="5.844000" f1="-0.232361" f3="359.989765"/>
<rec time="5.846000" f2="-0.001341" f3="359.989749"/>
<rec time="5.848000" f2="0.000447" f3="359.989754"/>
<rec time="5.850000" f2="0.000000"/>
Notice the second line is missing f2, the third and fourth are missing f1, the fifth is missing f1 and f3.
What would you like to have happen in those cases? There are even some records that are missing time information.
andrea vironda
2020 年 7 月 31 日
編集済み: andrea vironda
2020 年 7 月 31 日
Walter Roberson
2020 年 7 月 31 日
In the subset I show, there are three records in a row with no f1, so taking mean of two adjacent records would not be able to fill the gap.
There are places that have over 75 missing f1 in a row.
When a defective record is encountered, can the entire record be discarded, and everything calculated based on only the full records? Or should as much be recovered as possible (a slower more complicated process)?
andrea vironda
2020 年 7 月 31 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Characters and Strings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!