Load data from .MAT into .XML
이전 댓글 표시
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
2015년 10월 19일
0 개 추천
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...
카테고리
도움말 센터 및 File 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!