smirnov_test.m: update call to histc under Matlab

new-samplers
Johannes Pfeifer 2023-12-08 15:51:09 +01:00
parent 8d8176fc30
commit 97f6a4219b
1 changed files with 10 additions and 5 deletions

View File

@ -34,11 +34,16 @@ end
% empirical cdfs.
xmix= [x1;x2];
bin = [-inf ; sort(xmix) ; inf];
ncount1 = histc (x1 , bin);
ncount1 = ncount1(:);
ncount2 = histc (x2 , bin);
ncount2 = ncount2(:);
if isoctave
ncount1 = histc(x1 , bin);
else
ncount1 = histcounts(x1 , bin);
end
if isoctave
ncount2 = histc(x2 , bin);
else
ncount2 = histcounts(x2 , bin);
end
cum1 = cumsum(ncount1)./sum(ncount1);
cum1 = cum1(1:end-1);