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?

 Accepted Answer

KSSV
KSSV on 15 Sep 2016

5 Comments

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')
Perfect, thanks a lot!
Better to use built-in writestruct(struct, 'file.xml')
Note: writestruct() is new as of R2020b.

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!