-UP-
I still need some speed improvement. Can anybody help?
Here is the link for xml2struct command: https://de.mathworks.com/matlabcentral/fileexchange/28518-xml2struct
I also tried to read data by this code, adapted from another question on this page. However, i ain't got it working for time and speed increase was not apparent...
DOM=xmlread(file);
x_root = DOM.getFirstChild;
trkpt_nodes = x_root.getElementsByTagName('trkpt');
time_nodes = x_root.getElementsByTagName('time');
lon=NaN(trkpt_nodes.getLength);
lat=NaN(size(lon));
time=NaN(size(lon));
for i = 0 : trkpt_nodes.getLength - 1
trkpt_element = trkpt_nodes.item(i);
lat(i+1)=trkpt_element.getAttribute('lat');
lon(i+1)=trkpt_element.getAttribute('lon');
% time extraction missing
end