+ added some testcases
[qpalma.git] / scripts / createCoverageFigures.sh
1 #!/bin/bash
2
3 cat $1 | grep correct | cut -f 3 > correct.coverage_labels
4 cat $1 | grep wrong | cut -f 3 > wrong.coverage_labels
5
6 ( cat <<EOF
7 load correct.coverage_labels;
8 load wrong.coverage_labels;
9 correct_vec = zeros(10,1);
10 wrong_vec = zeros(10,1);
11 for i=1:10,
12 correct_vec(i) = sum([correct == (i-1)]);
13 wrong_vec(i) = sum([wrong == (i-1)]);
14 end
15 bar(correct_vec,1)
16 hold;
17 set(gca,'xlim',[0.5 length(correct_vec)+0.5])
18 xlabel('Confirmation count')
19 ylabel('Frequency')
20 set(gca,'XTick',[0.5,1.5,2.5,3.5,4.5,5.5,6.5,7.5,8.5,9.5,10.5])
21 set(gca,'XTickLabel',[0,1,2,3,4,5,6,7,8,9,10])
22 saveas(gcf,'pos_cov.eps')
23 clf;
24 bar(wrong_vec,1);
25 hold;
26 set(gca,'xlim',[0.5 length(correct_vec)+0.5])
27 xlabel('Confirmation count')
28 ylabel('Frequency')
29 set(gca,'XTick',[0.5,1.5,2.5,3.5,4.5,5.5,6.5,7.5,8.5,9.5,10.5])
30 set(gca,'XTickLabel',[0,1,2,3,4,5,6,7,8,9,10])
31 saveas(gcf,'neg_cov.eps')
32 EOF
33 ) > test_script.m
34
35 matlab -nojvm -r "test_script;" || echo -e "\nmatlab script failed!\n"