[FieldTrip] Inter-trial Coherence Stats

Seymour, Robert (Research Student) seymourr at aston.ac.uk
Fri May 19 08:46:08 CEST 2017


Dear Fieldtrippers,


I am trying to statistically evaluate inter-trial coherence on a virtual electrode, comparing an active to baseline period.


However I get the following error when using 'diff_ITC' and ft_freqstatistics:


Subscripted assignment dimension mismatch.

Error in ft_freqstatistics (line 141)
    dat(:,i) = tmp(:);



I can't seem to figure out what's going wrong... (code below). Has anyone else come across this error?


Many thanks,


Robert










%% Script to calculate inter-trial coherence for the alien clicktrain data
subject = sort({'RS','DB','MP','GR','DS','EC','VS','LA','AE','SY','GW',...
    'SW','DK','LH','KM','FL','AN'});

grandavgA = zeros(1,length(subject));
grandavgB = zeros(1,length(subject));

for i = 1:length(subject)

    load(['D:\Pilot\' subject{i} '\auditory\sourceloc\VE_A1_RH.mat']);

    cfg = [];
    cfg.foi = [30:1:80];
    cfg.method = 'mtmconvol';
    cfg.t_ftimwin = ones(length(cfg.foi),1).*0.5;
    cfg.tapsmofrq  = ones(length(cfg.foi),1).*8;
    cfg.toi    = 0:0.01:1.5;
    cfg.output = 'fourier';
    freq_post = (ft_freqanalysis(cfg, VE_A1_RH));
    freq_post.fourierspctrm = (freq_post.fourierspctrm);
    grandavgA{i} = freq_post;

    cfg.toi    = -1.5:0.01:0;
    freq_pre = (ft_freqanalysis(cfg, VE_A1_RH));
    freq_pre.fourierspctrm = (freq_pre.fourierspctrm);
    grandavgB{i} = freq_pre;
end

cfg = [];
cfg.latency          = [0 1.5];
cfg.parameter = 'fourierspctrm';
cfg.frequency        = [30 80];
cfg.method           = 'montecarlo';
cfg.statistic        = 'diff_ITC'
cfg.clusterstatistic = 'maxsum';
cfg.tail             = 0;
cfg.alpha            = 0.05;
cfg.numrandomization = 1000;

% Create design matrix based on specific number of trials from each
% participant
nsubj=numel(grandavgA);
cfg.design(1,:) = [1:nsubj 1:nsubj];
cfg.design(2,:) = [ones(1,nsubj) ones(1,nsubj)*2];
cfg.uvar        = 1; % row of design matrix that contains unit variable (in this case: subjects)
cfg.ivar        = 2; % row of design matrix that contains independent variable (the conditions)

[stat] = ft_freqstatistics(cfg, grandavgA{:}, grandavgB{:});

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20170519/0b0a604c/attachment.html>


More information about the fieldtrip mailing list