%%This function gets a matrix generated from the SampCompare function and
%%outputs a new matrix-freqSNPs which contains the number of samples
%%including each SNP
function  [freqSNPs]=GenerateFreqMatrix(matrix)
for i=1:length(matrix(:,1))
    sum=0;
    for j=2:length(matrix(i,:))
        if (matrix(i,j)>0)
            sum=sum+1;
        end
    end
    freqSNPs(i,1)=matrix(i,1);
    freqSNPs(i,2)=sum;
end
            
