FUNCTION REFERENCE
ttest
One-sample or paired Student t-test.
One-sample or paired Student t-test.
Syntax
[h,p,ci,stats] = ttest(x[,m_or_y][,'Alpha',a,'Tail',tail,'Dim',dim])Tests a mean against zero, a scalar mean, or paired observations of the same size. NaNs are removed per sample. Matrices are tested by column, or along Dim 1 or 2. Alpha defaults to 0.05; Tail is both, left or right. ci has two entries along the test dimension; stats contains tstat, df and sd. Legacy positional alpha, tail and dim are accepted; [] selects a default. Undefined p produces double NaN h.
Example
[h,p,ci,s] = ttest([1 2 4 7 9],3)Differences from MATLAB: real 2-D numeric/logical inputs; integer and single inputs produce double results.
These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.