How save a struct to an xml-File in Matlab?

I have a string in the workspace, that I can copy into an XML-File which then works perfectly fine. But how can I make Matlab directly save an xml from the string to a specified folder on my computer?

 Akzeptierte Antwort

KSSV
KSSV am 15 Sep. 2016

0 Stimmen

5 Kommentare

Johanna Maynes
Johanna Maynes am 15 Sep. 2016
Thank you for your hint, yes I have, it turns my struct into a string and saves it into the Workspace, but does not save an .XML file.
Dr. Siva Srinivas Kolukula comments
t saves the output into xml file....Read help..You have to call as follows to save output into xml file:
struct2xml(s,'myfile.xml')
Johanna Maynes
Johanna Maynes am 15 Sep. 2016
Perfect, thanks a lot!
Better to use built-in writestruct(struct, 'file.xml')
Note: writestruct() is new as of R2020b.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by