Index exceeds matrix dimensions error during sourceanalysis

Robert Oostenveld r.oostenveld at FCDONDERS.RU.NL
Wed Apr 11 21:19:31 CEST 2007


On 11 Apr 2007, at 10:09, Inge Westmijse wrote:

> % Source analysis with this broadband data
> cfg = [];
> cfg.method = 'lcmv';
> cfg.vol = ft_headshape;
> cfg.grid = Grid;
> cfg.rawtrial = 'no';
> cfg.keepfilter = 'yes';
>
> SourceBP = sourceanalysis(cfg,TLDataBandPassed);
>
> Everything goes fine until this last line, then I get the following
> error:
> ??? Index exceeds matrix dimensions.
>
> Error in ==> sourceanalysis at 944
>       data.cov = data.cov(seldata,seldata);
>
> Error in ==> SAMimitation_v110407 at 64
> SourceBP = sourceanalysis(cfg,TLDataBandPassed);
>
> I hope someone can help me, thanks in advance! Inge Westmijse

Hi Inge

There is a problem with selecting the data belonging to the desired
channels in the covariance matrix. Your timelock data contains only
151 MEG channels, and I suspect that you try to beam using both the
151 regular MEG channels but also the 23 or so reference MEG
channels. You should make sure that you select exactly the same
channels when preparing the leadfield, and when computing the LCMV
filter that you want to use in the subsequent broad-band beaming.
Please add cfg.channel="MEG' to each of the prepare_leadfield and
sourceanalysis steps.

Robert



More information about the fieldtrip mailing list