<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="">
Sorry Eleanor, I was unclear. I meant to ask about the ‘resample’ function. The fact that you get an error internally when this function is called, makes me suspect that you end up in a wrong (overloaded but with different functionality) m-file.
<div class=""><br class="">
</div>
<div class="">Best wishes,</div>
<div class="">Jan-Mathijs<br class="">
</div>
<div class=""><br class="">
</div>
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 13 May 2022, at 04:18, 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 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;" class="">
Hi Jan-Mathijs,</div>
<div 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;" class="">
<br class="">
</div>
<div 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;" class="">
thankyou for your reply. This is what I get (just the one version). </div>
<div 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;" class="">
<br class="">
</div>
<div 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;" class="">
>> which ft_resampledata<br class="">
C:\Users\Ellie\AppData\Roaming\MathWorks\MATLAB Add-Ons\Collections\fieldtrip-20220426\ft_resampledata.m<br class="">
</div>
<div 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;" class="">
<br class="">
</div>
<div 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;" class="">
I have also added the relevant fieldtrip directories using ft_defaults. </div>
<div 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;" class="">
<br class="">
</div>
<div 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;" class="">
Thankyou </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 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>
<div id="appendonsend" 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>
<hr tabindex="-1" 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; display: inline-block; width: 766.359375px;" 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=""></span>
<div id="divRplyFwdMsg" dir="ltr" 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="">
<font face="Calibri, sans-serif" style="font-size: 11pt;" class=""><b class="">From:</b><span class="Apple-converted-space"> </span>fieldtrip <<a href="mailto:fieldtrip-bounces@science.ru.nl" class="">fieldtrip-bounces@science.ru.nl</a>> on behalf of Schoffelen,
J.M. (Jan Mathijs) via fieldtrip <<a href="mailto:fieldtrip@science.ru.nl" class="">fieldtrip@science.ru.nl</a>><br class="">
<b class="">Sent:</b><span class="Apple-converted-space"> </span>12 May 2022 00:36<br class="">
<b class="">To:</b><span class="Apple-converted-space"> </span>FieldTrip discussion list <<a href="mailto:fieldtrip@science.ru.nl" class="">fieldtrip@science.ru.nl</a>><br class="">
<b class="">Cc:</b><span class="Apple-converted-space"> </span>Schoffelen, J.M. (Jan Mathijs) <<a href="mailto:janmathijs.schoffelen@donders.ru.nl" class="">janmathijs.schoffelen@donders.ru.nl</a>><br class="">
<b class="">Subject:</b><span class="Apple-converted-space"> </span>Re: [FieldTrip] Downsampling Issue</font>
<div class=""> </div>
</div>
<div class="" 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; word-wrap: break-word; line-break: after-white-space;">
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 class=""><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="x_Apple-interchange-newline">
<div class="">
<div class="x_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; 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="x_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="x_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="x_Apple-converted-space"> </span></div>
<div class=""><br class="">
</div>
<br class="">
</div>
<div class="" style="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; text-decoration: none;">
<div class="" style="font-family: Arial, Helvetica, sans-serif; font-size: 12pt;">
<br class="">
</div>
<div id="x_Signature" class="">
<div class="">
<div class="" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">
<span class="" style="font-family: "Times New Roman", Times, serif;"><br class="">
</span></div>
<div class="" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">
<span class="" style="font-family: "Times New Roman", Times, serif;">Eleanor Moses BPsych(Hons)</span></div>
<div class="" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">
<span class="" style="font-family: "Times New Roman", Times, serif;">PhD Candidate</span></div>
<div class="" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">
<span class="" style="font-family: "Times New Roman", Times, serif;">School of Psychology</span></div>
<div class="" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">
<span class="" style="font-family: "Times New Roman", Times, serif;">The University of Queensland</span></div>
<div class="" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">
<span class="" style="font-family: "Times New Roman", Times, serif;">Brisbane QLD 4072 Australia</span></div>
<div class="" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">
<span class="" style="font-family: "Times New Roman", Times, serif;">Email:<span class="x_Apple-converted-space"> </span><a href="mailto:eleanor.moses@uqconnect.edu.au" class="">eleanor.moses@uqconnect.edu.au</a></span></div>
<div class="" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">
<br class="">
</div>
</div>
</div>
</div>
<span class="" style="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; text-decoration: none; float: none; display: inline !important;">_______________________________________________</span><br class="" style="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; text-decoration: none;">
<span class="" style="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; text-decoration: none; float: none; display: inline !important;">fieldtrip
mailing list</span><br class="" style="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; text-decoration: none;">
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" class="" style="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;">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="" style="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; text-decoration: none;">
<a href="https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!6_puilsIXBSl-VOPdSiXILpOMezgn_ng1hMy0gaxjp0fc3pv8jiBwG1L_o4YBZTBM2aSjSABeEueTp4obfl-YYHVJS2isgYDW59U3Q$" class="" style="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;">https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!6_puilsIXBSl-VOPdSiXILpOMezgn_ng1hMy0gaxjp0fc3pv8jiBwG1L_o4YBZTBM2aSjSABeEueTp4obfl-YYHVJS2isgYDW59U3Q$</a><span class="" style="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; text-decoration: none; float: none; display: inline !important;"></span></div>
</blockquote>
</div>
<br class="">
</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!5vIRskZ8q-baSkTYVKHdrn-tPB6p06Sv84lJkNyIKzG_beWjwUTiOQ6UhsjasLhUt88MSABz0VqCVPID_otcJjv5FbnjGvV39_0KNA$" 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!5vIRskZ8q-baSkTYVKHdrn-tPB6p06Sv84lJkNyIKzG_beWjwUTiOQ6UhsjasLhUt88MSABz0VqCVPID_otcJjv5FbnjGvV39_0KNA$</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 class="Apple-converted-space"> </span></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="">
</div>
</blockquote>
</div>
<br class="">
</body>
</html>