query on coherence analysis

Ingrid Nieuwenhuis ingrid.nieuwenhuis at FCDONDERS.RU.NL
Tue Jun 6 13:33:28 CEST 2006


Dear Muthuraman,

cfg.xparam should not be 'foi', but 'freq' (see help singleplotER)

Bests,
Ingrid


-----Original Message-----
From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf
Of Muthuraman Muthuraman
Sent: Tuesday, June 06, 2006 11:20 AM
To: FIELDTRIP at NIC.SURFNET.NL
Subject: Re: [FIELDTRIP] query on coherence analysis

Hello

Thanks for the comments, i have downloaded the latest version
and now i am able to calculate using mtmwelch

but i get a error when i am plotting
i will included the matlab commands

>>cfg=[];
cfg.output='powandcsd';
cfg.method='mtmwelch';
cfg.foi=1:2:30;
numfoi = length(cfg.foi);
cfg.taper='hanning';
cfg.t_ftimwin=zeros(1,numfoi);
cfg.t_ftimwin(:)=0.5;
cfg.channel=channelselection({'EEG' 'EMG2'},data.label);
cfg.channelcmb={'EEG' 'EMG2'};
freq=freqanalysis(cfg,data);

>>fd=freqdescriptives([],freq);

cfg=[];
cfg.xparam='foi';
cfg.yparam='cohspctrm';
cfg.xlim=[0 30];
cfg.cohrefchannel='EMG2';
cfg.box='yes';
cfg.showlabels='yes';
cfg.channelname='EEG26';
singleplotER(cfg,fd);

??? Reference to non-existent field 'foi'.

Error in ==> singleplotER at 272
  plot(varargin{k-1}.(cfg.xparam), P, style);

with regards
muthu


>From: Robert Oostenveld <r.oostenveld at FCDONDERS.RU.NL>
>Reply-To: FieldTrip discussion list <FIELDTRIP at NIC.SURFNET.NL>
>To: FIELDTRIP at NIC.SURFNET.NL
>Subject: Re: [FIELDTRIP] query on coherence source analysis
>Date: Thu, 1 Jun 2006 13:58:48 +0200
>
>Dear Muthuraman
>
>I have not been able to reproduce your error. I suggest that you get  the
>latest version of FieldTrip from our FTP server and try again.
>
>best egards,
>Robert
>
>PS this is the test script I used. It uses some simulated data, which
>again uses a MEG gradiometer definition and a head model from the  tutorial

>data.
>
>
>-----------------
>% read some data that is required to simulate MEG data, i.e. volume  model,
>% sensor positions and MRI (optional, only for plotting)
>vol  = read_ctf_hdm('Subject01.hdm');
>hdr  = read_fcdc_header('Subject01.ds/Subject01.res4');
>grad = hdr.grad;
>
>% construct the simulated MEG data for condition A ("active")
>cfg               = [];
>cfg.vol           = vol;
>cfg.grad          = grad;
>cfg.fsample       = 300;
>cfg.ntrials       = 2;
>cfg.triallength   = 1;
>cfg.dip.pos       = [0 7 8];
>cfg.dip.mom       = [1 0 0];
>cfg.dip.signal    = sin(2*pi*10*(1:cfg.fsample)./cfg.fsample);
>cfg.absnoise      = 1e-8;
>data = dipolesimulation(cfg);
>
>% add the source signal as fake EMG channel
>for i=1:cfg.ntrials
>   data.trial{i}(end+1,:) = cfg.dip.signal + randn(size (cfg.dip.signal));
>end
>data.label{end+1} = 'EMG';
>
>cfg=[];
>cfg.output='powandcsd';
>cfg.method='mtmwelch';
>cfg.foi=1:2:30;
>numfoi = length(cfg.foi);
>cfg.taper='hanning';
>cfg.t_ftimwin=zeros(1,numfoi);
>cfg.t_ftimwin(:)=0.5;
>cfg.channel=channelselection({'MEG' 'EMG'},data.label);
>cfg.channelcmb={'MEG' 'EMG'};
>freq=freqanalysis(cfg,data);
>
>
>



More information about the fieldtrip mailing list