I'm not sure if it's a bug in matlab xml functions or in struct2xml but the problem is caused by nodes with empty text. struct2xml sets the text property of these nodes to [] instead of '' which matlab xml functions do not like. If I remember correctly, matlab used to treat both of these empty matrix the same, but is now a bit more strict about it.
It's a very simple fix. On line 166, of struct2xml, change
to
edit: And I've just noticed that the problem and fix is actually mentioned on the struct2xml page. edit2: Note that if all you want to do is change the time stamps of some of the node, converting the xml to struct and back is a waste of time. You would be better off learning how to navigate the DOM using the object returned by xmlread. It would be faster and would avoid the risk that either conversion fail.
Best Answer