% Null Hypothesis: Population 1 (pop1) and Population 2 (pop2) are NOT different
%
% Syntax: [p,t]=ttest(pop1,pop2)
%
% DBE 4/17/01

function [p,t]=ttest(pop1,pop2)
t=(mean(pop1)-mean(pop2)) / sqrt(std(pop1)^2/length(pop1) +std(pop2)^2/length(pop2));
dof=length(pop1)+length(pop2)-2;
s=student(t,dof);
p=1-s;
return;
