<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div>Dear all, <br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">I am new to fieldtrip and I would like to have your opinion about a bizarre error that I find trying to execute the function ft_combineplanar(). What am I trying to do is to  obtain the planar gradient from raw data. I use a neuromag306 Elekta MEG system.</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"> I tried to dig deeper into the scripts and I notice some quirks the error could
 derive from:<br>
<br>1. as soon as I call ft_combineplanar(cfg, data) , data.trials
 switches from 840 trials to 192 trials, without any command being 
provided that is BEFORE 
the first line of ft_combineplanar(cfg, data) being executed! At the same time all data.trials becomes empty arrays<br><br>2.
 my data structure does not contain the fields 'grad' before 
ft_combineplanar(cfg, data) has been called but it does afterwards . 
Again this happen without any command having been given <br>
<br>3. The error finally occurs in line 210 of the ft_combineplanar function (indexing error) and it's due to the data.trial array being empty<br><br></div><div>What do you think?<br><br></div>Best<br><br>Nic</div></body></html>