function dJukescantor = jukescantor(A) % hamming.m % % usage: distHamming=hamming(seqarray) % % Compute Hamming distances between all pairs of sequences % % seqarray is an array with each row a sequence in A,G,C,T; % Entry (i,j) in output matrices is distance from sequence % in ith row of seqarray to that in jth row. % Output matrix gives Hamming distances. % % 7/3/05 [n L]=size(A); %n=#of taxa, L=length of sequences dJukescantor=zeros(n,n); for i=1:n for j=1:n F=compseq(A(i,:),A(j,:)); dJukescantor(i,j)=distJC(F); end end