<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Helvetica;
        panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"Times New Roman \(Body CS\)";
        panose-1:2 11 6 4 2 2 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:Helvetica;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:Helvetica">Thanks Stephen and Jan-Mathijs, I appreciate the quick and helpful replies. Jan-Mathijs, I will try the solutions you suggested . . . but I’ve just gotten things working on my laptop,
 which has MATLAB2019, so maybe it’s time to just pester the IT department for a MATLAB upgrade on my desktop</span><span style="font-size:14.0pt;font-family:"Apple Color Emoji"">😊</span><span style="font-size:14.0pt;font-family:Helvetica"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:Helvetica"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:Helvetica">Thanks again!<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:Helvetica"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:Helvetica">Dan<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:Helvetica"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:Helvetica"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:12.0pt;color:black">From: </span></b><span style="font-size:12.0pt;color:black">fieldtrip <fieldtrip-bounces@science.ru.nl> on behalf of "Schoffelen, J.M. (Jan Mathijs)" <jan.schoffelen@donders.ru.nl><br>
<b>Reply-To: </b>FieldTrip discussion list <fieldtrip@science.ru.nl><br>
<b>Date: </b>Friday, August 23, 2019 at 2:08 AM<br>
<b>To: </b>FieldTrip discussion list <fieldtrip@science.ru.nl><br>
<b>Subject: </b>Re: [FieldTrip] Problem running tutorial<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p><b><span style="color:white;background:red">        External Email - Use Caution        </span></b><o:p></o:p></p>
<p class="MsoNormal">Dear Dan, <o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Sorry for the trouble. It is surprising (somewhat) that you get this error. Although I agree with Stephen, that using a more recent Matlab version would certainly work, but there are some checks and balances in fieldtrip that are aimed
 to prevent this backward compatibility issue that you encounter. Long story short: for ’newer’ matlab functions we provide overloaded versions of the same functions, which are to be used when a matlab version is used that pre-dates the introduction of the
 newer mathworks based functions.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">This should be automatically handled by a section in ft_defaults (starting from line 217 or so), where, based on the matlab version used, a set of ‘compat’ directories is added to the matlab path, which points to the relevant folders that
 contain the overloaded functionality. Somehow, in your setup this fails, and it fails silently, due to the ’try/catch/end’ statement that is around this block of code.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">So in order to get a better handle on this, you probably need to uncomment the ’try’ and its corresponding ‘end’, which would allow matlab to output an error message when calling ft_defaults. If you make the changes to ft_defaults, and
 then do the following on the matlab command line<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">restoredefaultpath;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">ft_defaults;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Then at least you will get an error message (probably) that indicates why the automatic addition of the relevant folders to the path does not work for you.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Another possibility would be to just add manually to the matlab path the folders that are needed, i.e. all fieldtrip/compat/matlabltX folders, where X is anything more recent than the version of matlab that you are using.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Hope this helps and with best wishes,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Jan-Mathijs<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">PS: just as a side note I recommend not to put the fieldtrip-folder in the MATLAB application’s toolbox directory, just to keep a clear distinction between the stuff that comes from Mathworks, and the code that comes from external parties
 (such as the fieldtrip team).<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><br>
<br>
<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal">On 23 Aug 2019, at 00:36, Stephen Whitmarsh <<a href="mailto:stephen.whitmarsh@gmail.com">stephen.whitmarsh@gmail.com</a>> wrote:<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<div>
<p class="MsoNormal">Dear Dan,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Yes, its your old matlab version; isfolder is a later MATLAB function. Can you get yourself an upgrade? Usually, your license will permit that, or your university would be able to do so. Matlab has improved a lot since, and in and case
 it will be increasingly difficult to keep things backwards compatible.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Cheers,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Stephen<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Thu, 22 Aug 2019, 22:59 Dillon, Daniel G., <<a href="mailto:ddillon@mclean.harvard.edu">ddillon@mclean.harvard.edu</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:14.0pt;font-family:Helvetica">Hi everyone. I’m new to FieldTrip and am excited to try it but I can’t get the tutorials started. I’ve downloaded fieldtrip-20190819
 and I’m running MATLAB_R2015b. I’m trying to run the “Trigger-based trial selection tutorial” (<a href="http://www.fieldtriptoolbox.org/tutorial/preprocessing/" target="_blank">http://www.fieldtriptoolbox.org/tutorial/preprocessing/</a>), but when I type “ft_definetrial(cfg)”
 in MATLAB it returns the long error pasted at the end of this email. It looks like there is a problem with the “isfolder” function, and since the warning message points me to the documentation about setting paths (<a href="http://bit.ly/2SPPjUS" target="_blank">http://bit.ly/2SPPjUS</a>),
 I also tried re-setting everything by typing this . . . </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:14.0pt;font-family:Helvetica"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<span style="font-size:14.0pt;font-family:Helvetica">>> restoredefaultpath</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<span style="font-size:14.0pt;font-family:Helvetica">>> addpath /Applications/MATLAB_R2015b.app/toolbox/fieldtrip-20190819/</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<span style="font-size:14.0pt;font-family:Helvetica">>> ft_defaults</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:14.0pt;font-family:Helvetica"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:14.0pt;font-family:Helvetica">. . . but I get the same error message. I think this may be a backwards compatibility issue but I’m not sure how to troubleshoot
 it. Can anyone point me in the right direction?</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:14.0pt;font-family:Helvetica"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:14.0pt;font-family:Helvetica">Thanks!</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:14.0pt;font-family:Helvetica"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:14.0pt;font-family:Helvetica">Dan Dillon</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:14.0pt;font-family:Helvetica">McLean Hospital</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:14.0pt;font-family:Helvetica"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:14.0pt;font-family:Helvetica"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:14.0pt;font-family:Helvetica">         
<b><u>Here’s the error message</u></b>:</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:14.0pt;font-family:Helvetica"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:14.0pt;font-family:Helvetica">          Warning: removing</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<span style="font-size:14.0pt;font-family:Helvetica">"/Applications/MATLAB_R2015b.app/toolbox/fieldtrip-20190819/compat/matlablt2017b" from your path,</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<span style="font-size:14.0pt;font-family:Helvetica">see <a href="http://bit.ly/2SPPjUS" target="_blank">
http://bit.ly/2SPPjUS</a> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<span style="font-size:14.0pt;font-family:Helvetica">> In isfolder (line 21)</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<span style="font-size:14.0pt;font-family:Helvetica">  In ft_version (line 64)</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<span style="font-size:14.0pt;font-family:Helvetica">  In ft_preamble_init (line 50)</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<span style="font-size:14.0pt;font-family:Helvetica">  In ft_preamble (line 83)</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<span style="font-size:14.0pt;font-family:Helvetica">  In ft_definetrial (line 128)
</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<span style="font-size:14.0pt;font-family:Helvetica">Error using feval</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<span style="font-size:14.0pt;font-family:Helvetica">Undefined function 'isfolder' for input arguments of type 'char'.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<span style="font-size:14.0pt;font-family:Helvetica"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<span style="font-size:14.0pt;font-family:Helvetica">Error in isfolder (line 27)</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<span style="font-size:14.0pt;font-family:Helvetica">    [varargout{1:nargout}] = feval(mfilename, varargin{:});</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<span style="font-size:14.0pt;font-family:Helvetica"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<span style="font-size:14.0pt;font-family:Helvetica">Error in ft_version (line 64)</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<span style="font-size:14.0pt;font-family:Helvetica">  issvn = isfolder(fullfile(ftpath, '.svn'));</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<span style="font-size:14.0pt;font-family:Helvetica"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<span style="font-size:14.0pt;font-family:Helvetica">Error in ft_preamble_init (line 50)</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<span style="font-size:14.0pt;font-family:Helvetica">[FjmoT6aA_ft_ver, FjmoT6aA_ft_path] = ft_version;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<span style="font-size:14.0pt;font-family:Helvetica"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<span style="font-size:14.0pt;font-family:Helvetica">Error in ft_preamble (line 83)</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<span style="font-size:14.0pt;font-family:Helvetica">evalin('caller', full_cmd);</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<span style="font-size:14.0pt;font-family:Helvetica"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<span style="font-size:14.0pt;font-family:Helvetica">Error in ft_definetrial (line 128)</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in">
<span style="font-size:14.0pt;font-family:Helvetica">ft_preamble init</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:14.0pt;font-family:Helvetica"> </span><o:p></o:p></p>
</div>
</div>
<p class="MsoNormal">_______________________________________________<br>
fieldtrip mailing list<br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
<a href="https://doi.org/10.1371/journal.pcbi.1002202" target="_blank">https://doi.org/10.1371/journal.pcbi.1002202</a><o:p></o:p></p>
</blockquote>
</div>
</div>
</div>
<p class="MsoNormal">_______________________________________________<br>
fieldtrip mailing list<br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
https://doi.org/10.1371/journal.pcbi.1002202<o:p></o:p></p>
</div>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
<p></p>

<p>The information in this e-mail is intended only for the person to whom it is<br>
addressed. If you believe this e-mail was sent to you in error and the e-mail<br>
contains patient information, please contact the Partners Compliance HelpLine at<br>
http://www.partners.org/complianceline . If the e-mail was sent to you in error<br>
but does not contain patient information, please contact the sender and properly<br>
dispose of the e-mail.</p></body>
</html>