<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:10pt;color:#000000;font-family:Arial,Helvetica,sans-serif;" dir="ltr">
<p>Dear Fieldtrippers, </p>
<p><br>
</p>
<p>I am trying to statistically evaluate inter-trial coherence on a virtual electrode, comparing an active to baseline period.</p>
<p><br>
</p>
<p>However I get the following error when using 'diff_ITC' and ft_freqstatistics:</p>
<p><br>
</p>
<p></p>
<div>Subscripted assignment dimension mismatch.</div>
<div><br>
</div>
<div>Error in ft_freqstatistics (line 141)</div>
<div> dat(:,i) = tmp(:);</div>
<br>
<p></p>
<p><br>
</p>
<p>I can't seem to figure out what's going wrong... (code below). Has anyone else come across this error?</p>
<p><br>
</p>
<p>Many thanks, </p>
<p><br>
</p>
<p>Robert</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<p></p>
<div>%% Script to calculate inter-trial coherence for the alien clicktrain data</div>
<div>subject = sort({'RS','DB','MP','GR','DS','EC','VS','LA','AE','SY','GW',...</div>
<div> 'SW','DK','LH','KM','FL','AN'});</div>
<div><br>
</div>
<div>grandavgA = zeros(1,length(subject));</div>
<div>grandavgB = zeros(1,length(subject));</div>
<div><br>
</div>
<div>for i = 1:length(subject)</div>
<div> </div>
<div> load(['D:\Pilot\' subject{i} '\auditory\sourceloc\VE_A1_RH.mat']);</div>
<div> </div>
<div> cfg = [];</div>
<div> cfg.foi = [30:1:80];</div>
<div> cfg.method = 'mtmconvol';</div>
<div> cfg.t_ftimwin = ones(length(cfg.foi),1).*0.5;</div>
<div> cfg.tapsmofrq = ones(length(cfg.foi),1).*8;</div>
<div> cfg.toi = 0:0.01:1.5;</div>
<div> cfg.output = 'fourier';</div>
<div> freq_post = (ft_freqanalysis(cfg, VE_A1_RH));</div>
<div> freq_post.fourierspctrm = (freq_post.fourierspctrm);</div>
<div> grandavgA{i} = freq_post;</div>
<div> </div>
<div> cfg.toi = -1.5:0.01:0;</div>
<div> freq_pre = (ft_freqanalysis(cfg, VE_A1_RH));</div>
<div> freq_pre.fourierspctrm = (freq_pre.fourierspctrm);</div>
<div> grandavgB{i} = freq_pre;</div>
<div>end</div>
<div><br>
</div>
<div>cfg = [];</div>
<div>cfg.latency = [0 1.5];</div>
<div>cfg.parameter = 'fourierspctrm';</div>
<div>cfg.frequency = [30 80];</div>
<div>cfg.method = 'montecarlo';</div>
<div>cfg.statistic = 'diff_ITC'</div>
<div>cfg.clusterstatistic = 'maxsum';</div>
<div>cfg.tail = 0;</div>
<div>cfg.alpha = 0.05;</div>
<div>cfg.numrandomization = 1000;</div>
<div><br>
</div>
<div>% Create design matrix based on specific number of trials from each</div>
<div>% participant</div>
<div>nsubj=numel(grandavgA);</div>
<div>cfg.design(1,:) = [1:nsubj 1:nsubj];</div>
<div>cfg.design(2,:) = [ones(1,nsubj) ones(1,nsubj)*2];</div>
<div>cfg.uvar = 1; % row of design matrix that contains unit variable (in this case: subjects)</div>
<div>cfg.ivar = 2; % row of design matrix that contains independent variable (the conditions)</div>
<div><br>
</div>
<div>[stat] = ft_freqstatistics(cfg, grandavgA{:}, grandavgB{:});</div>
<br>
<p></p>
<div id="Signature">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size:10pt; color:#000000; font-family:Arial,Helvetica,sans-serif">
<p><b></b></p>
</div>
</div>
</div>
</body>
</html>