plotting plv

Akiko Ikkai akiko at NYU.EDU
Mon Oct 11 00:54:28 CEST 2010


I'm trying to plot plv between channel pairs that I get from ft_connectivityanalysis.

when I run
cfg                  = [];
cfg.xparam           = 'time';
cfg.yparam           = 'freq';
cfg.zparam           = 'cohsprctm';  % need to run stat.cohsprctm = stat.plvspctrm;
                                                  % fixed in the latest version?
cfg.cohrefchannel    = '1';
cfg.layout = 'ordered';
cfg.showlabels       = 'yes';
cfg.colorbar         = 'yes';
figure; ft_multiplotTFR(cfg, stat)

I get this error:
ft_multiplotTFR(cfg, stat)
??? Index exceeds matrix dimensions.

Error in ==> ft_multiplotTFR at 242
datavector = data.(cfg.zparam)(seldat,yidc,xidc);

... I'm guessing the error is something like wrong channel combination or refchannel selection, but not able to locate where the error is coming from (have tried different channel combination). stat.dimord is "chan_chan_freq_time", which might not be formatted appropriately for ft_multiplotTFR...?  Below, I'm attaching the code used to get "stat" (plv).

Any suggestions? Thanks in advance! Akiko

%%%%% code for connectivityanalysis %%%%%%
cfg = [];
cfg.output ='fourier'; % instead of 'powandcsd'... fixed in the latest version?
cfg.method          = 'mtmconvol'; = {'1', '7', '120'}; % contra & unrelated channels to test
cfg.channelcmb = {'1' '7'; '1' '120'; '7', '120'};
cfg.keeptrials = 'yes';
cfg.keeptapers = 'no';
cfg.toi             = [-.8:.1:2]
cfg.foi             = [1:0.5:30];
cfg.taper           = 'hanning';
cfg.t_ftimwin       = zeros(1,length(cfg.foi));
cfg.t_ftimwin(:)    = 5./cfg.foi;
TFR = ft_freqanalysis(cfg, ft_data);

cfg.method  = 'plv';
[stat] = ft_connectivityanalysis(cfg,  TFR);

You are receiving this message because you are subscribed to
the  FieldTrip list. 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

More information about the fieldtrip mailing list