<div dir="ltr">Dear Conrado,<div>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>Which version  of MatLab are you running?</div><div><br></div><div>try to apply this change:</div><div>if exist(varname) -> if exist(varname,'var')</div><div><br></div><div>That should do it</div><div>I hope this helped!</div><div><br></div><div><br></div><div>Cris</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 25, 2016 at 2:28 PM, Conrado Bosman <span dir="ltr"><<a href="mailto:conrado.bosman@gmail.com" target="_blank">conrado.bosman@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Dear fieldtrippers,<div><br></div><div>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><br></div><div>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>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><br></div><div>Do you have any clue if I’m doing something wrong?</div><div><br></div><div>Thanks in advance!</div><div>Conrado</div><div> </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)"><span>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)"><span>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"><span></span><br></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)"><span>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)"><span>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"><span></span><br></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)"><span>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)"><span>  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"><span></span><br></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)"><span>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)"><span>        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"><span></span><br></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)"><span>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)"><span>    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)"><span><span style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px"> of a Neuralynx</span></span></div></div><br>_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br></blockquote></div><br></div>