|
I have a couple of text file I need to import data from and not sure really about the best way of going about these.
1) Easiest first,
No Joints :- 9
No Edges :- 5
Edge 1 :- 1 <-> 2
Edge 2 :- 2 <-> 3
Edge 3 :- 1 <-> 4
Edge 4 :- 1 <-> 5
Edge 5 :- 5 <-> 7
I need to grab grab the No Joint value and export to a variable, then have each "edge" "from" and "to" ideally as a matrix of nEdges x 2 (i.e to from for each edge). Would also be good to grab the No Edges value and check be able to check against the actual number of edge connections provided.
2)
No Joints :- 9
No Frames :- 2
Frame :- 1
Joint 1 :- 0.0556448 0.00532726 0.0993343
Joint 2 :- -0.0106789 -0.0177691 0.0243293
Joint 3 :- 0.0822542 0.144008 0.0473153
Joint 4 :- 0.127249 0.0704685 0.225934
Joint 5 :- 0.0241282 0.106974 0.00568629
Joint 6 :- 0.0943155 0.266603 0.0214314
Joint 7 :- 0.314652 0.176141 -0.0798468
Joint 8 :- 0.265005 0.163304 0.0688348
Joint 9 :- 0.265005 0.163304 0.0688348
Frame: 2
......
Again I need to grab out the No Joints variable, and this time the No Frames variable and check that have that amount of blocks. Then a cell array of nFrame elements, with each cell element containing a nJoints x 3 matrix of the jointPos.
Any help would be much appreciated.
|