-
Notifications
You must be signed in to change notification settings - Fork 0
/
gps2excel.m
48 lines (31 loc) · 1.06 KB
/
gps2excel.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
% This is a quick workaround, keep in mind that matalab has its own GPS
% toolbox which makes life easy.
%
% Instructions:
% change your .gpx fileneme to the variabe name fileneme or
% edit the name of your file to this name. and run
%
% Further developmenmt:
% this code can be improved to automatically read files and
% do all the file handling by itself. let me know if
% improvements are needed.
%
% Contact/feedback: [email protected]
% 10-Dec-15
clear;clc
filename = gpxread('gps-data-1.gpx');
gpsdata = zeros(length(filename),3);
gpsdata(:,1) = filename(:,1).Latitude;
gpsdata(:,2) = filename(:,1).Longitude;
time_x = filename.Time(:);
fileID = fopen('gps_data.csv','w');
for i = 1:length(filename)
time_element = time_x(i);
time_string = char(time_element);
fprintf(fileID,'%f, %f, %s\n', gpsdata(i,1), gpsdata(i,2), time_string);
end
fclose(fileID);
%% This is just to test git
%% This is again to test git
%% Git Again
%% Same