Rank: 285 based on 369 downloads (last 30 days) and 2 files submitted
photo

Wouter Falkena

E-mail
Company/University
Delft University of Technology
Lat/Long
51.99001312255859, 4.375315189361572

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Files Posted by Wouter View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
15 May 2012 xml2struct Convert an xml file into a MATLAB structure for easy access to the data. Author: Wouter Falkena xml, xml2struct, struct 280 28
  • 4.82143
4.8 | 29 ratings
02 Jan 2012 struct2xml Convert a MATLAB structure into a XML file. Author: Wouter Falkena struct2xml, struct, xml 89 17
  • 4.23077
4.2 | 13 ratings
Comments and Ratings by Wouter View all
Updated File Comments Rating
04 Jan 2012 struct2xml Convert a MATLAB structure into a XML file. Author: Wouter Falkena

Hi Harald,

The reason why the function requires a single field in the main structure is that a properly formatted XML document has a single root element (http://www.w3schools.com/xml/xml_dtd.asp). The only exception to that rule is a more elaborate XML preamble, which is currently not supported by the function.

For the second point, XML files usually have multiple elements with the same name. In order to convert this into a MATLAB structure, an array may be used. This means that isstruct(s.(curfield)) indeed may not work, but in that case
if iscell(s.(curfield))
min(cellfun(@(a) isstruct(a),s.curfield))
end
will tell you if all cells in the array are structures.

I hope this clarifies how to use the function a bit. If you have any more questions feel free to contact me.

Regards,
Wouter

02 Jan 2012 struct2xml Convert a MATLAB structure into a XML file. Author: Wouter Falkena

Hi Emil,

The function indeed replaces the characters -:. with _ (also see the function help). It should be possible to rewrite the function to replace : with something unique like _colon_ and let struct2xml replace this with :. Let me know if you still need this functionality. The structure names do get longer in that way...

Regards,
Wouter

19 Sep 2011 struct2xml Convert a MATLAB structure into a XML file. Author: Wouter Falkena

Thank you Herbert for finding and successfully eradicating this bug. I have uploaded the fixed file to the MATLAB Central.

04 Jul 2011 xml2struct Convert an xml file into a MATLAB structure for easy access to the data. Author: Wouter Falkena

Thank you for this suggestion Mr. Wanner. I have updated the file and it is currently under review by the MATLAB Central. It will appear here shortly.

13 Apr 2011 struct2xml Convert a MATLAB structure into a XML file. Author: Wouter Falkena

You are correct. However, isspace does not operate on cells. In the latest update I removed the for-loop all together and use isspace on the multi-line string. This is the fastest approach yet. Again, thank you for your support.

Comments and Ratings on Wouter's Files View all
Updated File Comment by Comments Rating
13 Jun 2014 struct2xml Convert a MATLAB structure into a XML file. Author: Wouter Falkena Raúl

Great script. I don't know why my struct 'S' is not written in a xml file. I'm using the following statement

file = struct2xml(S);

Where 'file' is the xml file where I want to save the struct and S my struct. However, non xml file is created. Can you help me? What am I missing?
Thanks

12 Jun 2014 xml2struct Convert an xml file into a MATLAB structure for easy access to the data. Author: Wouter Falkena du Plooy, Simon

Some of the attributes in the XML file had underscores at the beginning which error because of disallowed field name. Simple strrep solved the problem.

Great!

28 Mar 2014 struct2xml Convert a MATLAB structure into a XML file. Author: Wouter Falkena Carter, Romaine

Really nice

11 Mar 2014 xml2struct Convert an xml file into a MATLAB structure for easy access to the data. Author: Wouter Falkena Escobar Falcón, Luis Miguel

Excellent

06 Mar 2014 xml2struct Convert an xml file into a MATLAB structure for easy access to the data. Author: Wouter Falkena Fredrik

Contact us