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!