Error during regression Analysis of EEG data
이전 댓글 표시
I have been trying to run the regression analysis of EEG data and for the regressand(dependant variable) t-test, I tried running the below loop but I keep running into error. Can someone identify where I'm going wrong, please?
for ichan = 1:size(freqres.powspctrm,1)
for ifrq = 1:size(freqres.powspctrm,4)
cfg = [];
cfg.previous = freqres.cfg;
cfg.channel = freqres.label;
cfg.frequency = [2 40];
cfg.method = 'analytic';
cfg.statistic = 'depsamplesT';
cfg.alpha = 0.05;
cfg.tail = 1;
cfg.correctm = 'no';
Nsub = 11;
cfg.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)];
cfg.design(2,1:2*Nsub) = [1:Nsub 1:Nsub];
cfg.ivar = 1; % the 1st row in cfg.design contains the independent variable
cfg.uvar = 2; % the 2nd row in cfg.design contains the subject number
stat = ft_timelockstatistics(cfg,ichan{:}, ifrq{:});
end
end
댓글 수: 2
Geoff Hayes
2016년 1월 13일
Maazah - what is the error that you are observing? Please describe it and include the full error message. If the behaviour is unexpected, then describe the desired behaviour.
Maazah Ali
2016년 1월 13일
편집: Geoff Hayes
2016년 1월 14일
답변 (1개)
Walter Roberson
2016년 1월 13일
Your for loops on ichan and ifrq are over integers, 1 to the size of something. But your call has
stat = ft_timelockstatistics(cfg,ichan{:}, ifrq{:});
the {:} is only valid for cell arrays, but you are using {:} on those integers.
Your size are over freqres.powspctrm which must be at least 4 dimensional, so it is not obvious to me what you would be trying to index as a cell array. Maybe
stat = ft_timelockstatistics(cfg, freqres.powspctrm{ichan, :, :, ifrq})
카테고리
도움말 센터 및 File Exchange에서 EEG/MEG/ECoG에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!