-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGP.m
32 lines (31 loc) · 944 Bytes
/
GP.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
function [VS] = GP(VS,Grades)
if ~isempty(Grades)
G={Grades.grades};
Grades=(Grades(find(~cellfun(@isempty,G))));
gdex=find(strcmp([Grades.Sat],VS(1).Satellite)==1);
if ~isempty(gdex) && ~isempty(Grades(gdex).grades)
gradecells=string([Grades(gdex).grades.name]);
for j = 1:length(VS)
for k =1:length(gradecells)
dex(j,k)=strcmp(VS(j).ID,gradecells(k));
end
if sum(dex(j,:))>0
VS(j).grade=Grades(gdex).grades(find(dex(j,:)==1)).grade;
VS(j).stats=Grades(gdex).grades(find(dex(j,:)==1)).stats;
else
VS(j).grade = 'z';
VS(j).stats = 'z';
end
end
else
for j = 1:length(VS)
VS(j).grade = 'z';
VS(j).stats = 'z';
end
end
else
for j = 1:length(VS)
VS(j).grade = 'z';
VS(j).stats = 'z';
end
end