Two sample t-test not working

Hi guys I have tried to conduct a two sample t test on two matrix x and y where x is a 175x16 matrix and y is 1x16 matrix but the matlab gives me the following error:
h=ttest2 (x,y)
Error using mean
Too many output arguments.
Error in nanmean (line 17)
y = mean(varargin{:},'omitnan');
Error in ttest2 (line 171)
difference = nanmean(x,dim) - nanmean(y,dim);
Does anyone know a soultion for this?
Thanks for the help in advance.

4 件のコメント

Jos (10584)
Jos (10584) 2019 年 5 月 22 日
Did you, somehow, overloaded the function mean? What does
which mean
returns?
Abdullah Azzam
Abdullah Azzam 2019 年 5 月 22 日
It returns nothing how may I get it back?
Adam Danz
Adam Danz 2019 年 5 月 22 日
Somewhere in your code there is a custom function named "mean" (or it could be a global variable). You have to find where that happens and rename it to something else.
I'd start by searching for
which mean -all
which will likely list several function on your path, many of which will be followed by "Shadowed...". You'll need to look for any custom function in that list.
A temporary solution would be to clear "mean" just prior to calling ttest2() but this doesn't address the root of the problem.
clear('mean')
ttest2(....)
Abdullah Azzam
Abdullah Azzam 2019 年 5 月 22 日
It worked. It happens that I had created a function name mean I just renamed it and restart the program.
Thanks for your help.

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

回答 (0 件)

カテゴリ

製品

リリース

R2017a

質問済み:

2019 年 5 月 22 日

コメント済み:

2019 年 5 月 22 日

Community Treasure Hunt

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

Start Hunting!

Translated by