见matlab函数ttest的帮助,null hypothesis翻译成零假设[见概率论与数理统计第八章笔记,第一个概念就是零假设]。
matlab帮助是这么描述的:h = ttest(x) performs a t-test of the null hypothesis that data in the vector x are a random sample from a normal distribution with mean 0 and unknown variance, against the alternative that the mean is not 0. The result of the test is returned in h. h = 1 indicates a rejection of the null hypothesis at the 5% significance level. h = 0 indicates a failure to reject the null hypothesis at the 5% significance level.
翻译:h = ttest(x)执行t检验。零假设:x是均值为零的正态分布。备择假设:均值不是零。h = 1 表示以5%显著水平拒绝零假设。
 问题:ttest(x,y)与ttest(y,x)结果一样吗?
肯定一样,见matlab帮助,ttest(x,y)的零假设是:x-y是均值为零的随机变量。ttest(y,x)的零假设是:y-x是均值为零的随机变量。故两者等价。
例子:
论文ML-KNN:Alazy learning approach to multi-label learning(Pattern Recognition)的Table 2的第一行0.194±0.010   0.220±0.011,怎么判定前者显著好于后者?
ML-kNN 采用十折交叉验证得到十个Hamming loss组成一个向量x,BOOSTEXTER采用十折交叉验证得到十个Hamming loss组成一个向量y,ttext(x,y)=1表明具有统计显著性差异,ttext(x,y)=0表明不具有统计显著性差异

简单代码:
x = [0.1 0.15 0.13 0.24 0.26];
y = [0.2 0.21 0.58 0.06 0.04];
ttest(x,y)
ttest(y,x)

x = [0.1 0.15 0.13 0.24 0.26 0.21 0.26 0.28 0.36 0.38];%x的前五个值与原来相同
y = [0.2 0.21 0.58 0.06 0.04 0.46 0.54 0.91 0.58 0.75];%y的前五个值与原来相同,故意将y的后五个值与x的后五个值差异比较大
ttest(x,y)
ttest(y,x)