FieldTrip cellfun.m function destabilizing Matlab

Joseph Dien jdien07 at MAC.COM
Sat Apr 17 06:15:44 CEST 2010


Hi,
   I've been plagued by some odd behavior in Matlab, also reported by other users of my EP Toolkit (which requires installation of FieldTrip).  I've been able to isolate the cause as being the cellfun.m "upgrade" that is located in the compat/R13 and compat/R14 folders of the FieldTrip distribution.  When FieldTrip's version of cellfun.m is included in the path, a number of strange things happens (in this particular case, using Matlab 2008a on an Intel Mac under OS 10.6.2 but also seen in other configurations to at least some degree):

1) The following command stops working and produces the following error:

[fileNames, pathname] = uigetfile

??? Cell contents reference from a non-cell array object.

Error in ==> cellfun at 21
    argin{j} = varargin{j}{i};

Error in ==> iscellstr at 13
  res = cellfun('isclass',s,'char');

Error in ==> cell.ismember at 27
if ~((ischar(a) || iscellstr(a)) && (ischar(s) || iscellstr(s)))

Error in ==> AbstractFileDialog.AbstractFileDialog>AbstractFileDialog.set.InitialFileName at 71
            if any(ismember({'.', '..'}, iFile))

Error in ==> AbstractFileDialog.AbstractFileDialog>AbstractFileDialog.initialize at 259
            obj.InitialFileName = '';

Error in ==> UiFileOpenDialog.UiFileOpenDialog>UiFileOpenDialog.initialize at 121
            initialize at AbstractFileDialog(obj);

Error in ==> AbstractFileDialog.AbstractFileDialog>AbstractFileDialog.AbstractFileDialog at 26
            initialize(obj);

Error in ==> UiFileOpenDialog.UiFileOpenDialog>UiFileOpenDialog.UiFileOpenDialog at 9
        function obj = UiFileOpenDialog(varargin)

Error in ==> uigetputfile_helper at 40
    ufd = UiFileOpenDialog();

Error in ==> uigetfile at 125
    [filename, pathname, filterindex] = uigetputfile_helper(0, varargin{:});

2) The path listings becomes erratic.  Things happen like the FieldTrip paths disappear from the list, Matlab claims that a function is not on the path when you try to add a breakpoint to it even though it is indeed still on the path and being recognized by the "which" function etc. etc.

So first of all, I'd like to warn users of FieldTrip who are experiencing symptoms like this to make sure to drop the offending FieldTrip function from their path.  Unfortunately, I expect that some of the FieldTrip functions are depending on the presence of this "upgraded" cellfun.m function and will not work properly so I'm not sure what the effect of doing so is.

Second of all, I'd like to suggest to the developers that we should try to avoid replacing built-in Matlab functions as it can have unexpected effects on the rest of the system.  As I recall, we had to drop the Biosig Toolbox from the FieldTrip distribution for much the same reason.

Finally, I would be most obliged if the relevant FieldTrip developers could implement a fix for this problem.

Thanks!

Joe



--------------------------------------------------------------------------------

Joseph Dien,
Senior Research Scientist
University of Maryland

E-mail: jdien at umd.edu
Phone: 301-226-8848
Fax: 301-226-8811
http://homepage.mac.com/jdien07/


----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100417/3689076c/attachment-0001.html>


More information about the fieldtrip mailing list