Ttest function with random numbers

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

 採用された回答

the cyclist
the cyclist 2014 年 11 月 16 日

0 投票

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

1 件のコメント

Eric
Eric 2014 年 11 月 17 日
編集済み: Eric 2014 年 11 月 17 日
When I type 'which -all ttest' I only get a reference to the matlab function:
>> which -all ttest /Applications/MATLAB_R2013b.app/toolbox/stats/stats/ttest.m
The problem was somehow related: Matlab picked up a different nanmean function I had in my path.
Thank you for the help!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

質問済み:

2014 年 11 月 16 日

編集済み:

2014 年 11 月 17 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by