FIELDTRIP Digest - 8 Jan 2008 to 9 Jan 2008 (#2008-5)

Tom Holroyd tomh at KURAGE.NIMH.NIH.GOV
Wed Jan 16 21:13:20 CET 2008

> > ----- Original Message -----
> > From: Peter Lin <linpe at NINDS.NIH.GOV>
> > Date: Tuesday, January 8, 2008 9:34 pm
> > Subject: [FIELDTRIP] DICS pcc error
> > >
> > > ??? Error using ==> ctf2grad at 68
> > > unexpected number of coils in MEG channel

OK, the ultimate cause of the problem is line 143 in ctf_read_res4.m,
which reads:


it should be changed to:


and that'll fix it. It is interesting that this works in Octave but not
in real Matlab. What happens in Matlab with 'char' is that temp comes
back as an array of _shorts_. I have no idea at all why this happens,
it's completely wrong behavior. I'd appreciate it if somebody could
check me on this. I'm using Matlab With 'uchar' it works as
it should. What happens with 'char', in more detail, is that it reads
shorts, and the file pointer gets thrown off, and the gains, which are
read in next, get read as zero. Also the coil numbers.

Dr. Tom
To them sounds it pleasant to have preached in their ears: "Nothing is
worth while! You shall not will!" That, however, is a sermon for
slavery. Thus spoke Zarathustra.

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 and

More information about the fieldtrip mailing list