-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathGateScore_decision.m
More file actions
executable file
·42 lines (32 loc) · 1.04 KB
/
GateScore_decision.m
File metadata and controls
executable file
·42 lines (32 loc) · 1.04 KB
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
function [winner,I] = GateScore_decision(clashed_Roll_nos) % nu variable contains only rolls and Gate score
% read Gatescore excel file
%[nu,tx] = importdata('Student details.csv');
nu = getappdata(0,"nu");
%nu = nu.data;
for i = 1: length(clashed_Roll_nos)
person_clashed_row(i,1) = find(nu(:,1) == clashed_Roll_nos(i));
prewinner(i,:) = nu(person_clashed_row(i,1),:);
end
[~,I] = sort(prewinner(:,2),'descend');
winner = prewinner(I,:);
% D = zeros(length(tx),1);
% % converting Gatescore from the char to numeric
% for i=1:length(tx)
% d = str2num(char(tx(i,3)));
% if isempty(d)
% D(i)=0; % need to give a warning saying that the entry is null.
% else
% D(i)=d;
% end
% end
% ind1 = find(strcmpi(tx(:,2),clashed_Roll_nos(1)));
% ind2 = find(strcmpi(tx(:,2),clashed_Roll_nos(2)));
% % Get only first element in "ind1" and "ind2",
% % trust me, there are some duplicates
% ind1 = ind1(1); ind2 = ind2(1);
% if D(ind1) >= D(ind2)
% winner = char(tx(ind1,2));
% else
% winner = char(tx(ind2,2));
% end
end