How to use textscan for multiple variables
Mostrar comentarios más antiguos
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);
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Matrix Indexing en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!