<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="">
Dear Dan,
<div class=""><br class="">
</div>
<div class="">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.</div>
<div class="">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.</div>
<div class="">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</div>
<div class=""><br class="">
</div>
<div class="">restoredefaultpath;</div>
<div class="">ft_defaults;</div>
<div class=""><br class="">
</div>
<div class="">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.</div>
<div class=""><br class="">
</div>
<div class="">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.</div>
<div class=""><br class="">
</div>
<div class="">Hope this helps and with best wishes,</div>
<div class=""><br class="">
</div>
<div class="">Jan-Mathijs</div>
<div class=""><br class="">
<div>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).</div>
<div><br class="">
</div>
<div><br class="">
</div>
<div><br class="">
</div>
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 23 Aug 2019, at 00:36, Stephen Whitmarsh <<a href="mailto:stephen.whitmarsh@gmail.com" class="">stephen.whitmarsh@gmail.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="auto" class="">
<div class="">Dear Dan,</div>
<div dir="auto" class=""><br class="">
</div>
<div dir="auto" class="">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.</div>
<div dir="auto" class=""><br class="">
</div>
<div dir="auto" class="">Cheers,</div>
<div dir="auto" class="">Stephen</div>
<div dir="auto" class=""><br class="">
<div class="gmail_quote" dir="auto">
<div dir="ltr" class="gmail_attr">On Thu, 22 Aug 2019, 22:59 Dillon, Daniel G., <<a href="mailto:ddillon@mclean.harvard.edu" class="">ddillon@mclean.harvard.edu</a>> wrote:<br class="">
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-US" link="#0563C1" vlink="#954F72" class="">
<div class="m_9132042896900626573WordSection1">
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:Helvetica" class="">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" rel="noreferrer" class="">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" rel="noreferrer" class="">http://bit.ly/2SPPjUS</a>),
 I also tried re-setting everything by typing this . . . <u class=""></u><u class=""></u></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:Helvetica" class=""><u class=""></u> <u class=""></u></span></p>
<p class="MsoNormal" style="margin-left:.5in"><span style="font-size:14.0pt;font-family:Helvetica" class="">>> restoredefaultpath<u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin-left:.5in"><span style="font-size:14.0pt;font-family:Helvetica" class="">>> addpath /Applications/MATLAB_R2015b.app/toolbox/fieldtrip-20190819/<u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin-left:.5in"><span style="font-size:14.0pt;font-family:Helvetica" class="">>> ft_defaults<u class=""></u><u class=""></u></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:Helvetica" class=""><u class=""></u> <u class=""></u></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:Helvetica" class="">. . . 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?<u class=""></u><u class=""></u></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:Helvetica" class=""><u class=""></u> <u class=""></u></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:Helvetica" class="">Thanks!<u class=""></u><u class=""></u></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:Helvetica" class=""><u class=""></u> <u class=""></u></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:Helvetica" class="">Dan Dillon<u class=""></u><u class=""></u></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:Helvetica" class="">McLean Hospital<u class=""></u><u class=""></u></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:Helvetica" class=""><u class=""></u> <u class=""></u></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:Helvetica" class=""><u class=""></u> <u class=""></u></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:Helvetica" class="">         
<b class=""><u class="">Here’s the error message</u></b>:<u class=""></u><u class=""></u></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:Helvetica" class=""><u class=""></u> <u class=""></u></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:Helvetica" class="">          Warning: removing<u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin-left:.5in"><span style="font-size:14.0pt;font-family:Helvetica" class="">"/Applications/MATLAB_R2015b.app/toolbox/fieldtrip-20190819/compat/matlablt2017b" from your path,<u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin-left:.5in"><span style="font-size:14.0pt;font-family:Helvetica" class="">see
<a href="http://bit.ly/2SPPjUS" target="_blank" rel="noreferrer" class="">http://bit.ly/2SPPjUS</a>
<u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin-left:.5in"><span style="font-size:14.0pt;font-family:Helvetica" class="">> In isfolder (line 21)<u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin-left:.5in"><span style="font-size:14.0pt;font-family:Helvetica" class="">  In ft_version (line 64)<u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin-left:.5in"><span style="font-size:14.0pt;font-family:Helvetica" class="">  In ft_preamble_init (line 50)<u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin-left:.5in"><span style="font-size:14.0pt;font-family:Helvetica" class="">  In ft_preamble (line 83)<u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin-left:.5in"><span style="font-size:14.0pt;font-family:Helvetica" class="">  In ft_definetrial (line 128)
<u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin-left:.5in"><span style="font-size:14.0pt;font-family:Helvetica" class="">Error using feval<u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin-left:.5in"><span style="font-size:14.0pt;font-family:Helvetica" class="">Undefined function 'isfolder' for input arguments of type 'char'.<u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin-left:.5in"><span style="font-size:14.0pt;font-family:Helvetica" class=""><u class=""></u> <u class=""></u></span></p>
<p class="MsoNormal" style="margin-left:.5in"><span style="font-size:14.0pt;font-family:Helvetica" class="">Error in isfolder (line 27)<u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin-left:.5in"><span style="font-size:14.0pt;font-family:Helvetica" class="">    [varargout{1:nargout}] = feval(mfilename, varargin{:});<u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin-left:.5in"><span style="font-size:14.0pt;font-family:Helvetica" class=""><u class=""></u> <u class=""></u></span></p>
<p class="MsoNormal" style="margin-left:.5in"><span style="font-size:14.0pt;font-family:Helvetica" class="">Error in ft_version (line 64)<u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin-left:.5in"><span style="font-size:14.0pt;font-family:Helvetica" class="">  issvn = isfolder(fullfile(ftpath, '.svn'));<u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin-left:.5in"><span style="font-size:14.0pt;font-family:Helvetica" class=""><u class=""></u> <u class=""></u></span></p>
<p class="MsoNormal" style="margin-left:.5in"><span style="font-size:14.0pt;font-family:Helvetica" class="">Error in ft_preamble_init (line 50)<u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin-left:.5in"><span style="font-size:14.0pt;font-family:Helvetica" class="">[FjmoT6aA_ft_ver, FjmoT6aA_ft_path] = ft_version;<u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin-left:.5in"><span style="font-size:14.0pt;font-family:Helvetica" class=""><u class=""></u> <u class=""></u></span></p>
<p class="MsoNormal" style="margin-left:.5in"><span style="font-size:14.0pt;font-family:Helvetica" class="">Error in ft_preamble (line 83)<u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin-left:.5in"><span style="font-size:14.0pt;font-family:Helvetica" class="">evalin('caller', full_cmd);<u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin-left:.5in"><span style="font-size:14.0pt;font-family:Helvetica" class=""><u class=""></u> <u class=""></u></span></p>
<p class="MsoNormal" style="margin-left:.5in"><span style="font-size:14.0pt;font-family:Helvetica" class="">Error in ft_definetrial (line 128)<u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin-left:.5in"><span style="font-size:14.0pt;font-family:Helvetica" class="">ft_preamble init<u class=""></u><u class=""></u></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:Helvetica" class=""><u class=""></u> <u class=""></u></span></p>
</div>
</div>
_______________________________________________<br class="">
fieldtrip mailing list<br class="">
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer noreferrer" target="_blank" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="">
<a href="https://doi.org/10.1371/journal.pcbi.1002202" rel="noreferrer noreferrer" target="_blank" class="">https://doi.org/10.1371/journal.pcbi.1002202</a><br class="">
</blockquote>
</div>
</div>
</div>
_______________________________________________<br class="">
fieldtrip mailing list<br class="">
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="">
https://doi.org/10.1371/journal.pcbi.1002202<br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>