How to use textscan for multiple variables
Show older comments
Hello,
I am currently working on a project where i import a gpxfile without gpxread, and sort the data into variables (elevation, longitude, etc.).
However, my code keeps bringing up empty matrixes for my variables.
Any help would be appreciated!
filename = input('Open file: ', 's');
[fileID, errmsg]= fopen(filename);
if (fileID==-1)
disp(errmsg)
end
a=importdata(filename);
d=char(a)
~feof(fileID)
Latitude = textscan(d,'<trkpt lat="%f" lon="%f">\n');
for Longitude = textscan(d, 'long="%f">\n');
for Elevation = textscan(d, '<ele>%f</ele>)\n');
for Time = textscan (d, '<time>2020-02-01T%f3z</time>\n');
end
end
end
fgetl(chr);
Accepted Answer
More Answers (0)
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!