-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcell_array_parser_vn200.m
57 lines (44 loc) · 1.09 KB
/
cell_array_parser_vn200.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
49
50
51
52
53
54
55
56
57
function data = cell_array_parser_vn200(fileID, vn200)
if ~exist('vn200', 'var')
vn200 = false;
end
if (vn200)
of = 8;
else
of = 0;
end
tic
% read data to table, delimited by tab
T = readtable(fileID,'Delimiter','\t','ReadVariableNames',false);
if (~vn200)
if (size(T,2) == 32+8)
disp("Probably (old) vn200-data? add true as second argument or press to continue anyway");
pause;
elseif (size(T,2) == 47)
disp("Probably vn200-data? add true as second argument or press to continue anyway");
pause;
end
end
if (vn200)
if (size(T,2) == 47)
% 7 more fields in new
of = of+7;
end
end
if (vn200)
v_n = table2array(T(:,18));
v_e = table2array(T(:,19));
v_d = table2array(T(:,20));
else
v_n = 1e-2.*table2array(T(:,18));
v_e = 1e-2.*table2array(T(:,19));
v_d = 1e-2.*table2array(T(:,20));
end
for k=1:max(size(T))
% place data to struct
data(k).gps.v_n = v_n(k);
data(k).gps.v_e = v_e(k);
data(k).gps.v_d = v_d(k);
end
toc
end