How can I open all xml files?
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello,
I´m new in Matlab and I´m trying to open 8 files type xml, but I can´t.For now, Ihave wrotten this script:
% i have 8 files. % example of names: analysis_1245789632. All have the same name and the numbers are consecutives.
numberfiles=8; for indexFiles=1:numberfiles nameFile=['analysis_',num2str(indexFiles,'%10d'),'xml']; dates(indexFiles)=importdata(nameFiles); end
I have the follow error:
Error using importdata. Unable to open file.
Someone can help me??? please!!! I´m very frustrated with this!!
댓글 수: 0
답변 (1개)
Kan-Hua
2014년 3월 3일
First, I don't think Matlab's built-in importdata() function can handle XML file. You can use this package to read your xml data:
Also, this line of code
dates(indexFiles)=importdata(nameFiles)
won't work either. Assume you are importing a file that is supported by Matlab, you need to use a cell array to store them, because importadata() returns a matrix. The matrix "dates" cannot store a matrix as its element. You need something like:
dates{indexFiles}=importdata(nameFiles)
댓글 수: 0
참고 항목
카테고리
Help Center 및 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!