load examgradesx = grades(:,1);y = grades(:,2);[h,p,ci,stats] = ttest2(x,y)
When I run this code in Matlab 2019a, found on the ttest2 documentation page, I get the following error:
Error using sizeDimension argument must be a positive integer scalar within indexing range.Error in nanmean (line 43)count = size(x,dim) - sum(nans,dim);Error in nanvar (line 54)avg = nanmean(x,dim);Error in ttest2 (line 173)s2x = nanvar(x,[],dim);
Anyone understand what is going on here?
Thank you very much.
Ross
Best Answer