File Exchange

image thumbnail

struct2xml( s, varargin )

version 1.0.0.0 (9.62 KB) by Jacob Lynch August
Import XML file as MATLAB struct.

4 Downloads

Updated 15 Aug 2017

View License

Based on the work of Walter Faulkena, this submission includes logic to automatically convert arrays of structures into cells of structures, and to recursively remove empty Text fields that can cause xmlwrite to error.
See https://www.mathworks.com/matlabcentral/fileexchange/28639-struct2xml for W. Faulkena's original work.

Cite As

Jacob Lynch August (2020). struct2xml( s, varargin ) (https://www.mathworks.com/matlabcentral/fileexchange/64138-struct2xml-s-varargin), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (1)

Luis Saldarriaga

Hello Jacob, I read an xml file and converted it to str (xml2struct), after I change some values in specific children, and I want to write again like xml I used the code from Walter and Yours, but all the times I got the same message: Error processing the structure: There should be a single field in the main structure.;
could you help me ??
Regards

MATLAB Release Compatibility
Created with R2016b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Acknowledgements

Inspired by: struct2xml