How to use textscan for multiple variables
이전 댓글 표시
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);
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!