Dimensions error on paired t-test?

Hi all, I try to perform a paired t-test like that:
a=[1;2;3]
b=[10;20;30]
h = ttest(a,b)
and I get the following error message:
"Dimension argument must be a positive integer scalar within indexing range"
Does anyone know what's wrong?
Thanks, shir

6 件のコメント

Adam
Adam 2016 年 12 月 20 日
What does
which ttest
show?
shir shalom
shir shalom 2016 年 12 月 20 日
C:\Program Files\MATLAB\R2013b\toolbox\stats\stats\ttest.m
Adam
Adam 2016 年 12 月 20 日
I can't see how you would get that error in that case. I would suggest using the
dbstop if error
option to see exactly where it is that the error is being thrown from as you may have some overloaded version of a function that gets called by ttest.
Star Strider
Star Strider 2016 年 12 月 20 日
The which call needs to be:
which ttest -all
to check for overshadowing.
shir shalom
shir shalom 2016 年 12 月 21 日
It has the same result:
C:\Program Files\MATLAB\R2013b\toolbox\stats\stats\ttest.m
Adam
Adam 2016 年 12 月 21 日
The one that is active (not overshadowed) will always be the result of the simpler call though.

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

 採用された回答

Star Strider
Star Strider 2016 年 12 月 21 日

1 投票

Since you’re obviously not overshadowing, see if you have a path problem. The way to solve that is to run these two lines:
restoredefaultpath
rehash toolboxcache
That should solve path problems. If this doesn’t work, contact MathWorks Technical Support.

6 件のコメント

shir shalom
shir shalom 2016 年 12 月 21 日
OMG thank you it helped!!!!! Thank youuuuuuuuuu!!!
Star Strider
Star Strider 2016 年 12 月 21 日
As always, my pleasure!
shir shalom
shir shalom 2016 年 12 月 25 日
Hi, you're here?
so apparently I thought it worked cuz the ttest ran well, but my functions started to get weird errors.
when I put my folders first in the "set path", the ttest doesn't work. when I put them last, the ttest works fine, but my functions don't.
is it possible that it's because I moved all my folders to google drive?
please help. Thanks, Shir
Star Strider
Star Strider 2016 年 12 月 25 日
Yup!
I would keep all user files local in the user file directory (in Windows this is ‘C:\Users\-UserName-\Documents\MATLAB\’ and subdirectories). If you want to upload them to Google Drive to have them available on other computers, do so. I always run my scripts and functions from my local drive and MATLAB directory.
I don’t use Google Drive or other such services, so I have no experience with them. It may be possible to do what you want with Google Drive. I would Contact MathWorks Tech Support to see if what you want to do is an option.
shir shalom
shir shalom 2016 年 12 月 25 日
I contacted them. Thank you so much.
Star Strider
Star Strider 2016 年 12 月 25 日
My pleasure.

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

その他の回答 (0 件)

カテゴリ

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by