<div dir="ltr">Hello!!!!<div><br></div><div>Please Help out.  where am I going wrong?</div><div><br></div><div><div> cfg              = [];</div><div> cfg.channel   = 'EEG';</div><div> cfg.method   = 'sam';</div>

<div> cfg.grid        = grid;</div><div> cfg.vol         = vol1;</div><div> cfg.projectnoise = 'yes';</div><div> cfg.keepfilter = 'yes';</div><div> source = ft_sourceanalysis( cfg, timelock);</div></div><div>

<br></div><div>workspace of grid,vol1,timelock (.mat)</div><div><a href="https://www.dropbox.com/s/bu1inxwgeyc01mi/timelock%2Cgrid%2Cvol.mat?dl=0">https://www.dropbox.com/s/bu1inxwgeyc01mi/timelock%2Cgrid%2Cvol.mat?dl=0</a><br>

</div><div><br></div><div>1. Using fieldtrip 2013 version</div><div>When i do  EEG sourceanalysis using "SAM" method, following error occurs</div><div><br></div><div><div><font color="#ff0000">Attempted to access noise(0); index must be a positive integer or logical.</font></div>

<div><br></div><div><font color="#ff0000">Error in ==> beamformer_sam at 111</font></div><div><font color="#ff0000">  noise = noise(end);</font></div><div><font color="#ff0000"><br></font></div><div><font color="#ff0000">Error in ==> ft_sourceanalysis at 841</font></div>

<div><font color="#ff0000">      dip(i) = beamformer_sam(grid, sens, vol, squeeze_avg,squeeze(Cy(i,:,:)), optarg{:});</font></div></div><div><font color="#ff0000"><br></font></div><div><font color="#000000"><br></font></div>

<div><font color="#000000">PS: same code for MEG source reconsturction works quite good.</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">2. Using fieldtrip 2014 version</font></div><div>

<font color="#000000">when i do the same I'm getting this kind of errors</font></div><div><font color="#000000"><br></font></div><div><div><font color="#ff0000">Undefined function or variable 'abort'.</font></div>

<div><font color="#ff0000"><br></font></div><div><font color="#ff0000">Error in ==> ft_sourceanalysis at 156</font></div><div><font color="#ff0000">if abort</font></div></div><div><font color="#ff0000"><br></font></div>

<div>PS: Moreover, I cant even do preprocessing with 2014 fieldtrip version. It is showing same above error. </div><div><br></div><div><br></div><div>advance thanks for your kind help.</div><div><br></div><div>Praghajith R.S.</div>

<div><a href="mailto:praajhen@gmail.com">praajhen@gmail.com</a></div><div>Master Thesis @ UKSH</div><div>Kiel, Germany</div><div><br></div><div><font color="#ff0000"><br></font></div></div>