Load data from .MAT into .XML

22 次查看(过去 30 天)
Artur
Artur 2015-10-19
回答: Julian 2015-10-19
I made some measurements that are stored in .mat files as (e.g. 5x3) matrixes for different N conditions (so, generally 5x3xN-matrixes). How can I load the values from this matrixes into a .XML-pattern (see simplified version below)?
<?xml version="1.0" encoding="UTF-8"?>
<Data>
<X>1 2 3</X>
<Y>100 200 300 400 500</Y>
<ConditionAxis>25 125</ConditionAxis>
<Measurements>
<Condition>
<Values></Values>
<Values></Values>
<Values></Values>
<Values></Values>
<Values></Values>
% so that for the 1st condition it would be 5x3-matrix like this:
% <Values>1 2 3</Values>
% <Values>4 5 6</Values>
% <Values>7 8 9</Values>
% <Values>10 11 12</Values>
% <Values>13 14 15</Values>
</Condition>
<Condition>
<Values></Values>
<Values></Values>
<Values></Values>
<Values></Values>
<Values></Values>
% and here the other values for the 2nd condition and so on
</Condition>
</Measurements>
</Data>
Thanks before :)
Greetings, Artur

回答(1 个)

Julian
Julian 2015-10-19
With a single use-case you could just write your own function by expanding the example given in MATLAB help xmlwrite, or you could try out struct2xml or similar from the FileExchange...

类别

Help CenterFile Exchange 中查找有关 Structured Data and XML Documents 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by