[FieldTrip] Error in ft_hastoolbox

Robert Oostenveld r.oostenveld at donders.ru.nl
Wed May 25 23:14:00 CEST 2016


Hi Conrado, 

that should not hapen, as the code also tells you ;-)

Could you try replacing line 539 in ft_hastoolbox from

  status = exist(full_name, 'file');

into

  status = (exist(full_name, 'file')==3);

After that you should make sure that the ft_hastoolbox copy (which is present in multipe private directories) is updated by (on your Mac) running in a terminal

fieldtrip/bin/synchronize-private.sh 

the synchronize-private script runs autmatically upon each git commit, but with a manual change you sometimes have to do it by hand.

The recent change in this section of FieldTrip code was (as Cristiano mentioned) triggered by recent matlab incompatibilities in file detection, and in making it more octave compatible. But apparently we did not test all possible cases. Please let me know whether it works, I’ll then integrate it in the release version.

Best regards
Robert


> On 25 May 2016, at 15:50, Conrado Bosman <conrado.bosman at gmail.com> wrote:
> 
> Hey Cristiano,
> Thanks for the advice!
> 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
> 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
> 
> best
> Conrado
>> On 25 May 2016, at 15:23, Cristiano Micheli <michelic72 at gmail.com <mailto:michelic72 at gmail.com>> wrote:
>> 
>> Dear Conrado,
>> 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).
>> Which version  of MatLab are you running?
>> 
>> try to apply this change:
>> if exist(varname) -> if exist(varname,'var')
>> 
>> That should do it
>> I hope this helped!
>> 
>> 
>> Cris
>> 
>> On Wed, May 25, 2016 at 2:28 PM, Conrado Bosman <conrado.bosman at gmail.com <mailto:conrado.bosman at gmail.com>> wrote:
>> Dear fieldtrippers,
>> 
>> 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).
>> 
>> 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. 
>> 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
>> 
>> Do you have any clue if I’m doing something wrong?
>> 
>> Thanks in advance!
>> Conrado
>>  
>> K>> Error using ft_hastoolbox>is_present (line 576)
>> this should not happen
>> 
>> Error in ft_hastoolbox (line 378)
>> status = is_present(dependency);
>> 
>> Error in read_neuralynx_ncs (line 57)
>>   isMexv3 = ft_hastoolbox('neuralynx_v3', 2); % let's leave warnings for debug
>> 
>> Error in read_neuralynx_ds (line 84)
>>         orig(i) = read_neuralynx_ncs(fname{i}, 0, 0);
>> 
>> Error in ft_read_header (line 1576)
>>     hdr = read_neuralynx_ds(filename);
>>  of a Neuralynx
>> 
>> _______________________________________________
>> fieldtrip mailing list
>> fieldtrip at donders.ru.nl <mailto:fieldtrip at donders.ru.nl>
>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip <http://mailman.science.ru.nl/mailman/listinfo/fieldtrip>
>> 
>> _______________________________________________
>> fieldtrip mailing list
>> fieldtrip at donders.ru.nl <mailto:fieldtrip at donders.ru.nl>
>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> 
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20160525/6b7382ae/attachment.html>


More information about the fieldtrip mailing list