Convert XML file to a MATLAB structure

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

 Respuesta aceptada

Walter Roberson
Walter Roberson el 9 de Jun. de 2011

0 votos

Have you tried the built-in xmlread ? If so then what happened when you tried to use it?

Más respuestas (3)

Pritom Kumar Saha
Pritom Kumar Saha el 3 de Ag. de 2021

4 votos

Try
S = readstruct("abcd.xml")
it works on my matlab version.
It should work on matlab 2020b or higher version.

3 comentarios

NitzBr
NitzBr el 13 de Dic. de 2021
THANK YOU!
Seth
Seth el 9 de Mzo. de 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 el 19 de Dic. de 2022
Thanks, worked elegantly. No problem left on my side. Thanks again!

Iniciar sesión para comentar.

Etiquetas

Preguntada:

el 9 de Jun. de 2011

Comentada:

el 19 de Dic. de 2022

Community Treasure Hunt

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

Start Hunting!

Translated by