MATLAB: Ttest function with random numbers

ttest randn

Hi all,
I have the following problem with the ttest function:
[h, p, ci, stats] = ttest(randn(10,1), randn(10,1), 0.05)
Undefined function or variable 't'.
Error in nanmean (line 7) N = sum(~isnan(t), dim);
Error in ttest (line 131) xmean = nanmean(x,dim);
Anyone knows how to deal with this? Doesn't seem to be related to structure (tried squeeze).
Best regards,
Christian

Best Answer

My best guess is that you have inadvertently defined your own ttest function. What do you get if you type
which -all ttest
?
Related Question