%graphExample

G=[ 0,1,1,0,0,0,0,0,0,0;
    0 0 1 1 0 0 0 1 1 0;
    0 0 0 0 1 1 0 0 0 0;
    0 0 0 0 0 0 0 1 0 0;
    0 0 0 0 0 0 0 1 0 0;
    0 0 0 0 0 0 0 0 0 1;
    0 0 0 0 0 0 0 0 0 0;
    0 0 0 0 0 0 0 0 0 0; 
    0 0 0 0 0 0 0 0 0 0;
    0 1 0 0 0 0 1 0 1 0
];

indegree=sum(G)
outdegree=sum(G')
bin=0:4;
h=hist(indegree,bin);
subplot(1,2,1);
bar(bin,h);
title('indegree');

h=hist(outdegree,bin);
subplot(1,2,2);
bar(bin,h);
title('outdegree');
