Convert XML file to a MATLAB structure

143 visualizzazioni (ultimi 30 giorni)
I'm trying to convert a XML file to a matlab structure (I want to use numbers and data from the file), I've tried to use the suggested XML parse function from the website, but it does not work.
Is there another function or is there someone who could explain how to use the function? BR Johan

Risposta accettata

Walter Roberson
Walter Roberson il 9 Giu 2011
Have you tried the built-in xmlread ? If so then what happened when you tried to use it?

Più risposte (3)

Pritom Kumar Saha
Pritom Kumar Saha il 3 Ago 2021
Try
S = readstruct("abcd.xml")
it works on my matlab version.
It should work on matlab 2020b or higher version.
  3 Commenti
Seth
Seth il 9 Mar 2022
This worked for me very well - thank you!
xmlread did not work well for my files/data. This is a good example of why this site is so helpful!
S. Gokhun Tanyer
S. Gokhun Tanyer il 19 Dic 2022
Thanks, worked elegantly. No problem left on my side. Thanks again!

Accedi per commentare.


Brad
Brad il 12 Set 2011

wildan
wildan il 12 Ott 2011
How to convert DWG to XML. DWG is format from AutoCAD

Community Treasure Hunt

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

Start Hunting!

Translated by