Filter löschen
Filter löschen

How to convert the data entry where rows have uneven entry within xml into a table?

2 Ansichten (letzte 30 Tage)
While running the code on this data the centroid which is a variable has 385 entries, in which there are three variables. However on some rows there are four variables example on row number 12. There is entry of variable with name 1event. The loop stops at row 12 and give a error mentioned in the above picture. You can also see ME exception.
Thanks for your consideration.

Antworten (1)

Divyanshu am 27 Feb. 2024
Hi Praful,
The reason you are getting this error 'All tables being vertically concatenated must have same number of variables' is because table is a structured data and cannot have different number of columns in different rows.
A possible workaround can be :
  • Create a table with number of columns equal to maximum variables of all the entries of XML file.
  • Now for each item on xml file create a row and fill the variables/columns with values.
  • If the current item is having less variables than maximum, you can fill those columns with '-'.
Hope it helps!

Community Treasure Hunt

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

Start Hunting!

Translated by