No License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
XML4MAT v2.0

4.8 | 6 ratings Rate this file 13 Downloads (last 30 days) File Size: 235 KB File ID: #6268 Version: 1.0
image thumbnail

XML4MAT v2.0



12 Nov 2004 (Updated )

Converts XML to and from MATLAB structured variables.

| Watch this File

File Information

Inter-conversion between MATLAB structured variables and XML strings. A markup language was defined to support string representation of any MATLAB variable. Additional m-functions support import of any XML structure. The final picture: any XML --> MbML <--> MATLAB.

Manuscript describing original (v1.0) of tbox was published at:

Almeida, J.S., Wu, S., and Voit, E.O. (2003) XML4MAT: Inter-conversion between MatlabTM structured variables and the markup language MbML. Computer Science Preprint Archive (Elsevier), 2003(12):9-17.


This file inspired Shortstool: Browse Through User Shortcut Toolbar.

MATLAB release MATLAB 7 (R14)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (9)
09 Mar 2014 Eric Nunes

This software is great.
I have a tree class defined in matlab with two variable nodes and parent. I want to convert it into an xml file. Do I just give the object of the class as input to the mat2xml function. And what is VARNAME?

Comment only
06 Aug 2012 Sebastian Holmqvist

Awesome piece of software!

My only gripe is the GNU license part. If only it was released under the BSD license it could be more widely used.

13 Jan 2012 Mirko

Mirko (view profile)

Hi, I've some problem with a file like this: any Suggestions?
The result struct is not the same as the one I expected. Ok for duplication of fields/substruct when I've the same tag (<value> in this case). But something missing, i.e. sourcefileselectedcodes is not stored in result struct.

<?xml version="1.0" ?>
Put here comments


Thank you.

Comment only
11 Apr 2011 Charles Garfinkle

Also, opening a matlabpool and having some of the for loops in xml2mat.m done in parallel (parfor) results in a significant increase in speed for large trees.

Comment only
05 Apr 2011 Charles Garfinkle

Fantastic. The only edit I needed to make was to have mbmling.m also remove horizontal tabs between elements by adding the following between lines 25 and 26:


Otherwise, the presence of tabs between elements of the XML file caused xml2struct.m to throw an error and xml2cell.m to create cells containing structures that combine child elements with the parent element's last attribute (rather than creating separate cells for each child and parent attribute).

05 Apr 2011 Charles Garfinkle

Sorry, between lines 25 and 26, not 26 and 27.

10 Apr 2010 Kevin

Kevin (view profile)

Very nice job. Impressive, elegant design. Love the open source too.

One thing I had to do right away was add a large precision to the num2str function in mat2xml. I was dealing with large values and needed the precision to remain. Line 35:

15 Dec 2006 Jaakko R

Just works for me.

11 Jun 2005 lyhwus lywhus

Very good sofware and is open source

Contact us