function pairs(A,ind) % pairwise scatterplots of the selected columns of A clf; [p n]=size(A); n=length(ind); a=min(A(:,ind)); b=max(A(:,ind)); del=(b-a)/8; a=a-del; b=b+del; pic=1; for i=1:(n-1) for j=(i+1):n subplot(n-1,n-1,pic) hold on; xlabel(['A',int2str(ind(j))]); ylabel(['A',int2str(ind(i))]); axis([a(j) b(j) a(i) b(i)]); for h=1:p text(A(h,ind(j)),A(h,ind(i)),int2str(h)) end; hold off; pic=pic+1; end; pic=pic+i; end; hold off; %