www.gusucode.com > stats 源码程序 matlab案例代码 > stats/TTestForAHypothesizedMeanExample.m

    %% t-Test for a Hypothesized Mean  

%% 
% Load the sample data. Create a vector containing the first column of the
% students' exam grades data. 
load examgrades
x = grades(:,1);  

%% 
% Test the null hypothesis that sample data comes from a distribution with
% mean |m = 75|. 
h = ttest(x,75) 

%%
% The returned value of |h = 0| indicates that |ttest| does not reject the
% null hypothesis at the 5% significance level.