%% Read XML File into MATLAB® Structure Array
% Create a parsing function to read an XML file into a MATLAB® structure, and then read a sample XML file into the MATLAB workspace.
% To create the function parseXML, copy and paste this code into an m-file parseXML.m, or use the parseXML.m included in this example. The parseXML function parses data from an XML file into a MATLAB structure array with fields Name, Attributes, Data, and Children.

type('parseXML.m')

% Use the parseXML function to parse the sample file info.xml into a MATLAB structure.

sampleXMLfile = 'info.xml';
mlStruct = parseXML(sampleXMLfile)

% Copyright 2018 The MathWorks, Inc.