loaded file is pathname

조회 수: 4 (최근 30일)
Lois Bosschaart
Lois Bosschaart 2019년 3월 25일
댓글: Lois Bosschaart 2019년 3월 26일
Hi!
I want to load a .xml file, but instead of the file I get the PathName as mij 'loaded' file. Can anyone help me?
This is my code:
clear all
close all
clc
[FileName, PathName] = uigetfile('*.xml','Select the .xml file');
XMLFile = fullfile(PathName,FileName);
This is what I get in my Workspace. A char with the pathname..
Schermafdruk 2019-03-25 15.19.10.png

답변 (3개)

Alex Mcaulley
Alex Mcaulley 2019년 3월 25일
You are not loading the file. fullfile function just build the name of the file.
You need to use xmlread function:

Fangjun Jiang
Fangjun Jiang 2019년 3월 25일
Increase the width of the "Value" column, you will see the full string. Or type "XMLFile" in Command Window.

Image Analyst
Image Analyst 2019년 3월 25일
XMLFile is a character string that contains the filename.
To get the contents of that XML file you need the xmlread() function.
  댓글 수: 3
Image Analyst
Image Analyst 2019년 3월 25일
I agree. The XML reading functions in MATLAB are complicated and confusing. That's why I use a utility written by a university that returns the XML file in a friendly and easy to use structure. See attached.
Lois Bosschaart
Lois Bosschaart 2019년 3월 26일
Thanks a lot! It is fixed :)

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile 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