% Exaple of a paired t-test, by Sam G., 6/20/07 x=[120 124 130 118 140 128 140 135 126 130 126 127 128 131 131 127 132 125 141 137 118 132 129 135] % y=[128 131 131,127 132 125 141 137 118 132 129 135] % [h,p,ci,stats]=ttest(x(1:12),x(13:end)) stats.tstat % % The above does the paired t-test the first set of numbers in x against %the second set of numbers in vector x. The result should be h=1 which % indicates the rejection of null hypothesis, h=0 mean accepting the Ho % . Also, P, the confidence interval, DF, and t values are given. % http://www.mathworks.com/access/helpdesk/help/toolbox/stats/ttest.html % above is the Web for ttest