-
-
Save jasonLaster/2651524 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%data | |
%human_data = ... | |
%comp_data = ... | |
% find the number of rounds played | |
hrounds = size(human_data,1); | |
crounds = size(comp_data,1); | |
% find the beginning of the different games | |
first_col = @(data, ncols) data(data < ncols); | |
hbeginnings = first_col(find(human_data==9), hrounds); | |
cbeginnings = first_col(find(comp_data==9), crounds); | |
% build a sequence of rounds plays without beginnings | |
human_seq = human_data; human_seq(hbeginnings,:) = []; | |
comp_seq = comp_data; comp_seq(cbeginnings,:) = []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if true | |
% human distribution | |
hdisti = @(n) size(find(human_seq == n),1); | |
hdist = cell2mat(arrayfun(hdisti, 1:3, 'UniformOutput',false)); | |
% computer distribution | |
cdisti = @(n) size(find(comp_seq(:,1) == n),1); | |
cdist = cell2mat(arrayfun(cdisti, 1:3, 'UniformOutput',false)); | |
% total distribution | |
tdist = hdist + cdist | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment