How to Export XML file

Hi,
I am new for mat-lab , below my mat-lab code export data to XML file ?
I have input video file read getting dynamic values like:
for i=1:10
%Video File Frame count (10),
matrix{1,i}=[4,5,3,2,2,2,21,3,4];%cell array 1-by-8 matrix ,export to vector data.
Note:In XML file like format i would like to export data from mat-lab please let me know .Thanks
end

5 个评论

SAMEER ahamed
SAMEER ahamed 2014-2-24
编辑:SAMEER ahamed 2014-2-24
Now i have tried to write XML code in mat-lab up to id.after that how i can declared from matrix..?please let me know .thank's.further understanding please look my previous forum.
Now i have got below result like please let me know where i have done mistaken ?
if true
% code
docNode = com.mathworks.xml.XMLUtils.createDocument('lipreading');
docRootNode = docNode.getDocumentElement;
thisElement = docNode.createElement('id');
%Here I would call each frame 1-by-8 matrix , but i have tried to use for loop but not working properly any method or looping let me know .
docRootNode.appendChild(thisElement);
docRootNode.appendChild(matrix_thisElement);
xmlFileName =['tempname','.xml'];
xmlwrite(xmlFileName,docNode);
edit(xmlFileName);
end
Note : I have Attached my xml file please let me know thanks.
<<
>>
Patrik Ek
Patrik Ek 2014-2-25
编辑:Patrik Ek 2014-2-25
The most seems fine to me here, you have even got a xml file. Could you please state the problem? Are you saying you want do declare a matrix in an xml file? If so there are some complications to that so please give a clearer statement of the problem before I go into this.
Thank's for reply me .I have input video file read frame each frame different values 1-by-8 matrix. I want to form my coordinates values like matrix=[[3,2,1,3,2,4,3,2],[4,2,4,23,2,2,4],[4,5,3,22,3,5,7,9]];etc. so these values need to stored in XML file below like
if true
% code
<edu.lipreading.Sample>
<id>GoodMorning2 08:52:13 25/02/2014</id>
<matrix class="vector"/>
<vector>
<int>3</int>
<int>2</int>
<int>1</int>
<int>3</int>
<int>2</int>
<int>4</int>
<int>2</int>
<int>1</int>
</vector>
<vector>
<int>4</int>
<int>2</int>
<int>4</int>
<int>2</int>
<int>3</int>
<int>23</int>
<int>2</int>
<int>4</int>
</vector>
</matrix>
</edu.lipreading.Sample>
end
Note : I have got below result like, but i wanna to stored values like above form .
if true
% code
for i=1:10 % Input video file read frames
matrix{1,i}=[co-ordinate_x,co-ordinate_y,co-ordinate_xx;co-ordinate_xy;co-ordinate_zx;co-ordinate_zy;co-ordinate_px;co-ordinate_py];%here dynamic values
end
end
I am not 100% sure on this one, but I think that you will need to store it as a vector vector here.

请先登录,再进行评论。

回答(0 个)

类别

帮助中心File Exchange 中查找有关 Workspace Variables and MAT Files 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by