loaded file is pathname
Ältere Kommentare anzeigen
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..

Antworten (3)
Alex Mcaulley
am 25 Mär. 2019
0 Stimmen
You are not loading the file. fullfile function just build the name of the file.
You need to use xmlread function:
Fangjun Jiang
am 25 Mär. 2019
0 Stimmen
Increase the width of the "Value" column, you will see the full string. Or type "XMLFile" in Command Window.
Image Analyst
am 25 Mär. 2019
0 Stimmen
XMLFile is a character string that contains the filename.
To get the contents of that XML file you need the xmlread() function.
3 Kommentare
Lois Bosschaart
am 25 Mär. 2019
Image Analyst
am 25 Mär. 2019
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
am 26 Mär. 2019
Kategorien
Mehr zu Workspace Variables and MAT Files finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!