<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hey Cristiano,<div class="">Thanks for the advice!</div><div class="">The problem that I’m seeing is that exist should evaluate whether the mex file exits or not. In that sense, in the actual version, the developers are using exist(varname,’file’) which I think it is correct</div><div class="">The problem is that the output is neither a string, cell or logical values. It gives you a double valued 3 which is exactly what you expect if you are evaluating a mex file which is present in the matlab path. But in is_present, number 3 is not considered as a reasonable output and that’s why is given you this weird “this should not be happen” message. Maybe I will write Robert directly, it seems to me that this is a bug of the code</div><div class=""><br class=""></div><div class="">best</div><div class="">Conrado</div><div class=""><div><blockquote type="cite" class=""><div class="">On 25 May 2016, at 15:23, Cristiano Micheli <<a href="mailto:michelic72@gmail.com" class="">michelic72@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Dear Conrado,<div class="">I encountered this error before and it is due to a changed arguments set in the exist function for one of the latest MatLab versions (I think starting from 2014a if I remember well).</div><div class="">Which version  of MatLab are you running?</div><div class=""><br class=""></div><div class="">try to apply this change:</div><div class="">if exist(varname) -> if exist(varname,'var')</div><div class=""><br class=""></div><div class="">That should do it</div><div class="">I hope this helped!</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Cris</div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Wed, May 25, 2016 at 2:28 PM, Conrado Bosman <span dir="ltr" class=""><<a href="mailto:conrado.bosman@gmail.com" target="_blank" class="">conrado.bosman@gmail.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="">Dear fieldtrippers,<div class=""><br class=""></div><div class="">I’m trying to read the header of a Neuralynx dataset, using the last FieldTrip version available at Github, running on a Linux machine. I encounter the following error (see below).</div><div class=""><br class=""></div><div class="">Originally, I thought that the problem could be related to a FieldTrip dependency on a .mex file, that should be downloaded from the Neuralynx website (‘Neuralynx file reader and writer for Matlab on Linux and Mac OS X’), so I downloaded, compiled and placed the toolbox on a recognizable MATLAB path. </div><div class="">Then, when I run ft_hastoolbox, I noticed that the value of the variable dependency is “3”, which is the expected outcome from the MATLAB function “exist" (which is used in the helper function has_mex from ft_hastoolbox (l539)), when you have a recognizable mex file. However, the value 3 provides you the cryptic error message in “is_present” at line 576</div><div class=""><br class=""></div><div class="">Do you have any clue if I’m doing something wrong?</div><div class=""><br class=""></div><div class="">Thanks in advance!</div><div class="">Conrado</div><div class=""> </div><div class=""><div class=""><div style="margin:0px;font-size:18px;line-height:normal;font-family:'Andale Mono';color:rgb(0,249,0);background-color:rgb(0,0,0)" class=""><span class="">K>> Error using ft_hastoolbox>is_present (line 576)</span></div><div style="margin:0px;font-size:18px;line-height:normal;font-family:'Andale Mono';color:rgb(0,249,0);background-color:rgb(0,0,0)" class=""><span class="">this should not happen</span></div><div style="margin:0px;font-size:18px;line-height:normal;font-family:'Andale Mono';color:rgb(0,249,0);background-color:rgb(0,0,0);min-height:20px" class=""><span class=""></span><br class=""></div><div style="margin:0px;font-size:18px;line-height:normal;font-family:'Andale Mono';color:rgb(0,249,0);background-color:rgb(0,0,0)" class=""><span class="">Error in ft_hastoolbox (line 378)</span></div><div style="margin:0px;font-size:18px;line-height:normal;font-family:'Andale Mono';color:rgb(0,249,0);background-color:rgb(0,0,0)" class=""><span class="">status = is_present(dependency);</span></div><div style="margin:0px;font-size:18px;line-height:normal;font-family:'Andale Mono';color:rgb(0,249,0);background-color:rgb(0,0,0);min-height:20px" class=""><span class=""></span><br class=""></div><div style="margin:0px;font-size:18px;line-height:normal;font-family:'Andale Mono';color:rgb(0,249,0);background-color:rgb(0,0,0)" class=""><span class="">Error in read_neuralynx_ncs (line 57)</span></div><div style="margin:0px;font-size:18px;line-height:normal;font-family:'Andale Mono';color:rgb(0,249,0);background-color:rgb(0,0,0)" class=""><span class="">  isMexv3 = ft_hastoolbox('neuralynx_v3', 2); % let's leave warnings for debug</span></div><div style="margin:0px;font-size:18px;line-height:normal;font-family:'Andale Mono';color:rgb(0,249,0);background-color:rgb(0,0,0);min-height:20px" class=""><span class=""></span><br class=""></div><div style="margin:0px;font-size:18px;line-height:normal;font-family:'Andale Mono';color:rgb(0,249,0);background-color:rgb(0,0,0)" class=""><span class="">Error in read_neuralynx_ds (line 84)</span></div><div style="margin:0px;font-size:18px;line-height:normal;font-family:'Andale Mono';color:rgb(0,249,0);background-color:rgb(0,0,0)" class=""><span class="">        orig(i) = read_neuralynx_ncs(fname{i}, 0, 0);</span></div><div style="margin:0px;font-size:18px;line-height:normal;font-family:'Andale Mono';color:rgb(0,249,0);background-color:rgb(0,0,0);min-height:20px" class=""><span class=""></span><br class=""></div><div style="margin:0px;font-size:18px;line-height:normal;font-family:'Andale Mono';color:rgb(0,249,0);background-color:rgb(0,0,0)" class=""><span class="">Error in ft_read_header (line 1576)</span></div><div style="margin:0px;font-size:18px;line-height:normal;font-family:'Andale Mono';color:rgb(0,249,0);background-color:rgb(0,0,0)" class=""><span class="">    hdr = read_neuralynx_ds(filename);</span></div></div></div><div style="margin:0px;font-size:18px;line-height:normal;font-family:'Andale Mono';color:rgb(0,249,0);background-color:rgb(0,0,0)" class=""><span class=""><span style="font-family: Helvetica; font-size: 12px;" class=""> of a Neuralynx</span></span></div></div><br class="">_______________________________________________<br class="">
fieldtrip mailing list<br class="">
<a href="mailto:fieldtrip@donders.ru.nl" class="">fieldtrip@donders.ru.nl</a><br class="">
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank" class="">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class=""></blockquote></div><br class=""></div>
_______________________________________________<br class="">fieldtrip mailing list<br class=""><a href="mailto:fieldtrip@donders.ru.nl" class="">fieldtrip@donders.ru.nl</a><br class="">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</div></blockquote></div><br class=""></div></body></html>