Dear Marcel,<div>I might have seen a similar error before when the number of channels in 'elec' do not match the number of channels in 'freq'.   Could that be the cause?</div><div><br></div><div>Also, does it matter that you are setting cfg.grad=elec, rather than cfg.elec=elec?</div>

<div><br></div><div>To debug, it might be best to first call leadfield=ft_prepare_leadfield() to ensure that is computed correctly, and then set that output to cfg.grid.leadfield=leadfield, in your call to ft_sourceanalysis.<br>

<br>cheers,</div><div>Johanna</div><div><br><div class="gmail_quote">2012/6/26 Marcel Heers <span dir="ltr"><<a href="mailto:marcel.heers@googlemail.com" target="_blank">marcel.heers@googlemail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Dear all,<br>
<br>
I am trying to perform source localization in the frequency domain<br>
from EEG data using DICS. The data were recorded combined with MEG<br>
(Neuromag data format).  The volume conductor is a 3 shell realistic<br>
head model created with bemcp.<br>
When running DICS with the following settings<br>
<br>
cfg                   = [];<br>
cfg.method       = 'dics';<br>
cfg.grad            = elec;<br>
cfg.frequency    = 14;<br>
cfg.vol              = vol_eeg;<br>
cfg.dics.projectnoise = 'yes';<br>
cfg.dics.lambda       = 5;<br>
source = ft_sourceanalysis(cfg, freq);<br>
<br>
<br>
I am am getting the following error message:<br>
<br>
??? Error using ==> svd<br>
Input to SVD must not contain NaN or Inf.<br>
<br>
Error in ==> beamformer_dics>pinv at 568<br>
  [U,S,V] = svd(A,0);<br>
<br>
Error in ==> beamformer_dics at 314<br>
        filt = pinv(lf' * invCf * lf) * lf' * invCf;              %<br>
Gross eqn. 3, use<br>
        PINV/SVD to cover rank deficient leadfield<br>
<br>
Error in ==> ft_sourceanalysis at 584<br>
      dip(i) = beamformer_dics(grid, sens, vol, [],<br>
squeeze(Cf(i,:,:)), optarg{:});<br>
<br>
<br>
and I am not sure what might be the cause.<br>
<br>
Maybe anyone can help me! Thank you in advance!<br>
<br>
Marcel<br>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
</blockquote></div><br></div>