-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathget_data_point.m
49 lines (30 loc) · 1.04 KB
/
get_data_point.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
function [Point] = get_data_point(Points_data, Num)
tab = Points_data;
l = size(tab,1);
for i=1:1:l+1
if (i==l+1)
disp('Unknown Point');
else
if (tab{i,1} == Num)
Point = struct('Num', tab{i,1}, 'Time', tab{i,2}, ...
'Acc', tab{i,6}, 'List_PRN', convertVect(tab{i,7}), ...
'Lat',tab{i,3}, 'Long', tab{i,4}, 'Alt', tab{i,5});
break
else
disp('Research...');
Point = 0;
end
end
end
end
%%
%Function who convert the String of PRN number into a vector whith each
%numbers (so we have a PRN for an indice given)
function [Vec_PRN] = convertVect(List_PRN)
str = strsplit(List_PRN, ','); %découpage de la chaine
l = length(str);
Vec_PRN = zeros(l,1); %initialisation du vecteur
for i=1:1:length(str)
Vec_PRN(i) = str2num(str{i});
end
end