<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Hi Eleanor,
<div class=""><br class="">
</div>
<div class="">Could it be that you have an unexpected version of resampledata on your matlab path? What do you get if you type which resampledata on the matlab command line?</div>
<div class=""><br class="">
</div>
<div class="">Best wishes,</div>
<div class="">Jan-Mathijs<br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 11 May 2022, at 10:45, Eleanor Moses via fieldtrip <<a href="mailto:fieldtrip@science.ru.nl" class="">fieldtrip@science.ru.nl</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="elementToProof" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Arial, Helvetica, sans-serif; font-size: 12pt;">
Dear community,
<div class=""><br class="">
</div>
<div class="">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 class="">However, I keep running into the same error with the ft_resampledata function.</div>
<div class=""><br class="">
</div>
<div class="">When I attempt to downsample, this is the error I get</div>
<div class=""><br class="">
</div>
<div class="">Check for incorrect argument data type or missing argument in call to function 'resample'.</div>
<div class=""><br class="">
</div>
<div class="">Error in ft_resampledata (line 231)</div>
<div class="">        newdat = transpose(resample(transpose(olddat),fsres,fsorig));</div>
<div class=""><br class="">
</div>
<div class="">Error in Fieldtrip_Test (line 27)</div>
<div class="">data_eeg = ft_resampledata(cfg, data_eeg);</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">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 class="">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 class="">When I remove the resampling section from my preprocessing pipeline script, it otherwise works fine, and works with mvpa functions from cosmomvpa.</div>
<div class="">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 class="">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 class=""><br class="">
</div>
<div class="">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 class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">I have included the data structure and cfg's for the function below.<span class="Apple-converted-space"> </span></div>
<div class=""><br class="">
</div>
<div class="">% Raw data configuration</div>
<div class="">%            hdr: [1×1 struct]</div>
<div class="">%          label: {73×1 cell}</div>
<div class="">%           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 class="">%          trial: {[73×391168 double]}</div>
<div class="">%        fsample: 1024</div>
<div class="">%     sampleinfo: [1 391168]</div>
<div class="">%            cfg: [1×1 struct]</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">cfg = [];</div>
<div class="">cfg.resamplefs = 256;</div>
<div class="">cfg.detrend = 'no';<span class="Apple-converted-space"> </span></div>
<div class="">data_eeg = ft_resampledata(cfg, data_eeg);</div>
<div class=""><br class="">
</div>
<div class="">Any help would be greatly appreciated, kind regards</div>
<div class=""><br class="">
</div>
<div class="">Eleanor Moses<span class="Apple-converted-space"> </span></div>
<div class=""><br class="">
</div>
<br class="">
</div>
<div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<div style="font-family: Arial, Helvetica, sans-serif; font-size: 12pt;" class="">
<br class="">
</div>
<div id="Signature" class="">
<div class="">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">
<span style="font-family: "Times New Roman", Times, serif;" class=""><br class="">
</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">
<span style="font-family: "Times New Roman", Times, serif;" class="">Eleanor Moses BPsych(Hons)</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">
<span style="font-family: "Times New Roman", Times, serif;" class="">PhD Candidate</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">
<span style="font-family: "Times New Roman", Times, serif;" class="">School of Psychology</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">
<span style="font-family: "Times New Roman", Times, serif;" class="">The University of Queensland</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">
<span style="font-family: "Times New Roman", Times, serif;" class="">Brisbane QLD 4072 Australia</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">
<span style="font-family: "Times New Roman", Times, serif;" class="">Email:<span class="Apple-converted-space"> </span><a href="mailto:eleanor.moses@uqconnect.edu.au" class="">eleanor.moses@uqconnect.edu.au</a></span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">
<br class="">
</div>
</div>
</div>
</div>
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">_______________________________________________</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">fieldtrip
 mailing list</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<a href="https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!6_puilsIXBSl-VOPdSiXILpOMezgn_ng1hMy0gaxjp0fc3pv8jiBwG1L_o4YBZTBM2aSjSABeEueTp4obfl-YYHVJS2isgYDW59U3Q$" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!6_puilsIXBSl-VOPdSiXILpOMezgn_ng1hMy0gaxjp0fc3pv8jiBwG1L_o4YBZTBM2aSjSABeEueTp4obfl-YYHVJS2isgYDW59U3Q$</a><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class=""></span></div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>