Problems with ttest function
조회 수: 2 (최근 30일)
이전 댓글 표시
Hello,
I've been trying to use the ttest function to compute a paired ttest between power values obtained from EEG (pre vs post) using the following function:
pval = 0.05 [h, p, ci, stats] = ttest(EEG1, EEG2, pval);
and
[h, p, ci, stats] = ttest(squeeze(EEG1), squeeze(EEG2), pval);
But it gives me the same error:
Undefined function or variable 't'.
Error in nanmean (line 7) N = sum(~isnan(t), dim);
Error in ttest (line 131) xmean = nanmean(x,dim);
Is this because the NaN function is not working? If so, does anyone know how to fix it?
Best regards,
Christian
댓글 수: 0
답변 (1개)
Star Strider
2014년 10월 3일
What are the dimensions of ‘EEG1’ and ‘EEG2’? What is the result of isnan on both arrays?
I would start by plotting ‘EEG1’ and ‘EEG2’ as functions of frequency on the same plot, then doing nanmean of both, since that seems to be where the problem is.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 EEG/MEG/ECoG에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!