<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Dear community,
<div><br>
</div>
<div>I am new to fieldtrip and am trying to preprocess my EEG data so that it was be compatible with later analysis using cosmomvpa.
</div>
<div>However, I keep running into the same error with the ft_resampledata function.
</div>
<div><br>
</div>
<div>When I attempt to downsample, this is the error I get</div>
<div><br>
</div>
<div>Check for incorrect argument data type or missing argument in call to function 'resample'.</div>
<div><br>
</div>
<div>Error in ft_resampledata (line 231)</div>
<div>        newdat = transpose(resample(transpose(olddat),fsres,fsorig));</div>
<div><br>
</div>
<div>Error in Fieldtrip_Test (line 27)</div>
<div>data_eeg = ft_resampledata(cfg, data_eeg);</div>
<div><br>
</div>
<div><br>
</div>
<div>I have checked previous posts to the community, to check that I am not encourting previously posted errors (I am downsampling from 1024Hz to 512, or have tried to 256, so this is a neat integer division which was a problem previously discussed that produced
 this error with ft_resampledata).</div>
<div>I have ensured that I have specified all necessary configurations (cfg.resamplefs = 512; cfg.detrend = 'no';) and aside from this am using the default configurations.
</div>
<div>When I remove the resampling section from my preprocessing pipeline script, it otherwise works fine, and works with mvpa functions from cosmomvpa.
</div>
<div>I tried to apply the ft_resampledata function after the ft_preprocessing function as the help ft_resampledata notes indicate that data should be
</div>
<div>resampled as obtained from the ft_preprocessing function, but encounter the same error even if I rearrange when I use ft_resampledata (before pre-proc, right after importing data).
</div>
<div><br>
</div>
<div>I also encounter this error when I try to run tutorial fieldtrip preprocessing scripts that I have downloaded from the cosmomvpa website - so the error isn't unique to my script.
</div>
<div><br>
</div>
<div><br>
</div>
<div>I have included the data structure and cfg's for the function below. </div>
<div><br>
</div>
<div>% Raw data configuration</div>
<div>%            hdr: [1×1 struct]</div>
<div>%          label: {73×1 cell}</div>
<div>%           time: {[0 9.7656e-04 0.0020 0.0029 0.0039 0.0049 0.0059 0.0068 0.0078 0.0088 0.0098 0.0107 … ]}</div>
<div>%          trial: {[73×391168 double]}</div>
<div>%        fsample: 1024</div>
<div>%     sampleinfo: [1 391168]</div>
<div>%            cfg: [1×1 struct]</div>
<div><br>
</div>
<div><br>
</div>
<div>cfg = [];</div>
<div>cfg.resamplefs = 256;</div>
<div>cfg.detrend = 'no'; </div>
<div>data_eeg = ft_resampledata(cfg, data_eeg);</div>
<div><br>
</div>
<div>Any help would be greatly appreciated, kind regards</div>
<div><br>
</div>
<div>Eleanor Moses </div>
<div><br>
</div>
<br>
</div>
<div>
<div style="font-family: Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="Signature">
<div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span style="font-family:"Times New Roman",Times,serif"><br>
</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span style="font-family:"Times New Roman",Times,serif">Eleanor Moses BPsych(Hons)</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span style="font-family:"Times New Roman",Times,serif">PhD Candidate</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span style="font-family:"Times New Roman",Times,serif">School of Psychology</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span style="font-family:"Times New Roman",Times,serif">The University of Queensland</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span style="font-family:"Times New Roman",Times,serif">Brisbane QLD 4072 Australia</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span style="font-family:"Times New Roman",Times,serif">Email: eleanor.moses@uqconnect.edu.au</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
</div>
</div>
</div>
</body>
</html>