Back to the main page.
Bug 41 - matlab 7.04 from windows platform cannot read keyval
Status |
CLOSED FIXED |
Reported |
2010-02-24 11:01:00 +0100 |
Modified |
2010-03-08 16:25:16 +0100 |
Product: |
FieldTrip |
Component: |
preproc |
Version: |
unspecified |
Hardware: |
PC |
Operating System: |
Windows |
Importance: |
P5 minor |
Assigned to: |
Robert Oostenveld |
URL: |
|
Tags: |
|
Depends on: |
|
Blocks: |
|
See also: |
|
Tim Engelkes - 2010-02-24 11:01:23 +0100
From a windows platform matlab 7.04 can not call keyval command blocking the use of tutorial examples preprocessing - trigger based trial selection ..and following
http://fieldtrip.fcdonders.nl/tutorial/preprocessing
cfg = [];
cfg.dataset = 'Subject01.ds';
cfg.trialdef.eventtype = 'backpanel trigger';
cfg.trialdef.eventvalue = 3; % the value of the stimulus trigger for fully incongruent (FIC).
cfg.trialdef.prestim = 1;
cfg.trialdef.poststim = 2;
cfg = definetrial(cfg);
Resulting in:
??? Function name must be a string.
Error in ==> keyval at 27
if ~all(cellfun(@ischar, keys))
Error in ==> checkconfig at 64
renamed = keyval('renamed', varargin);
Error in ==> ft_definetrial at 71
cfg = checkconfig(cfg, 'trackconfig', 'on');
Error in ==> definetrial at 17
[varargout{1:nargout}] = funhandle(varargin{:});
Robert Oostenveld - 2010-03-08 16:25:05 +0100
I have fixed the problem by adding a fieldtrip/compat/R13 and R14 directory with a replacement cellfun function inside them.
The old one was limited to
>> which cellfun
/opt/matlab-6.5.1/toolbox/matlab/datatypes/cellfun.mexglx
>> help cellfun
CELLFUN Functions on cell array contents.
D = CELLFUN(FUN, C) where FUN is one of
'isreal' -- true for real cell element
'isempty' -- true for empty cell element
'islogical' -- true for logical cell element
'length' -- length of cell element
'ndims' -- number of dimensions of cell element
'prodofsize'-- number of elements in cell element
and C is the cell array, returns the results of
applying the specified function to each element
of the cell array. D is a double array the same
size as C containing the results of applying FUN on
the corresponding cell elements of C.
D = CELLFUN('size', C, K) returns the size along
the K-th dimension of each element of C.
D = CELLFUN('isclass', C, CLASSNAME) returns true
for a cell element if the class of the element
matches the CLASSNAME string. Unlike the ISA function,
'isclass' of a subclass of CLASSNAME returns false.
Note: When C contains objects, CELLFUN does not call any
overloaded versions of FUN.
the new/custom one is more similar to the CELLFUN of later matlabs. Note that uniformoutput is always assumed and multiple outputs are not supported.