<div dir="ltr">Dear community,<br><div><br></div><div>I zero-padded my already epoched data using the following code:</div><div>    trl         = 1;<br>    padtype     = 'zero';<br>    padlength   = 500; % n. of samples to be padded before and after the data<br>    zeroPadData = cell(1,size(data_SL.trial,2));<br>    while trl <= size(data_SL.trial,2)<br>        zeroPadData{trl} = ft_preproc_padding(data_SL.trial{trl}, padtype, padlength);<br>        trl = trl + 1;<br>    end   <br>    data_SL.trial = zeroPadData;<br>    clear zeroPadData; clear trl; clear padlength; clear padtype;<br></div><div><br></div><div>After zero-padding, I'm trying to run "ft_frequanalysis" using the following parameters:</div><div>        cfg              = [];<br>        cfg.output       = 'pow';<br>        cfg.method       = 'mtmconvol';<br>        cfg.taper        = 'hanning';<br>        cfg.foi          = 4:1:50;        <br>        cfg.t_ftimwin    = ones(length(cfg.foi),1).*.2;   % length of time window = 0.2 sec<br>        cfg.toi          = -1:0.05:1.5;   % time window "slides" from -1.0 to 1.5 sec in steps of 0.05 sec <br>        TFRhann          = ft_freqanalysis(cfg, data_SL);<br></div><div><br></div><div>However, I get the following error:</div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>Error using ft_datatype_raw (line 83)</div><div>inconsistent number of samples in trial 1</div><div><br></div><div>Error in ft_checkdata (line 268)</div><div>  data = ft_datatype_raw(data, 'hassampleinfo',</div><div>  hassampleinfo);</div><div><br></div><div>Error in ft_freqanalysis (line 212)</div><div>data = ft_checkdata(data, 'datatype', {'raw',</div><div>'raw+comp', 'mvar'}, 'feedback', cfg.feedback,</div><div>'hassampleinfo', 'yes');</div><div><br></div></blockquote><br><div>Before the zero-padding, each trial had 1500 data points, whereas after zero-padding, each trial got extra 1000 zeros (500 zeros at the beginning and 500 zeros at the end of the trial), totaling 2500 data points.</div><div><br></div><div>I'm not sure whether I'm zero-padding the data correctly.  The "ft_preproc_padding" function seems not to accept the whole data structure ("data_SL"), but just a specific part of it ("data_SL.trial"), so that the only way that I've found to make it work was as shown above. Consequently, the other parts of the data structure are not updated, creating inconsistencies (which I suspect are causing the error). </div><div><br></div><div>Can anyone help me with this?</div><div><br></div><div><br></div><div>Thank you all in advance!</div><div><br></div><div>Best,</div><div>Carolina Ogawa</div><div><br></div><div> </div><div><br></div><div> </div></div>