Dear fieldtrippers,<br><br>With neuromag306 data, after the old style of .grad gets converted to the new style, the field have dimensions as follows:<br><br>data.grad:<br><br>ans = <br><br>       unit: 'mm'<br>      label: {306x1 cell}<br>

    coilori: [510x3 double]<br>    coilpos: [510x3 double]<br>        lab: {102x3 cell}<br>    chanpos: [102x3 double]<br>    chanori: [102x3 double]<br>    balance: [1x1 struct]<br><br>Because there are three sensors in each location, there are 1/3 as many elements in chanpos as in coilpos.<br>

<br>However, in ft_combineplanar, where the function remakes the .grad field to match the new list of channels (where the gradiometers have been combined), is uses a list of channel indices 'sel' which is concatenated vertically:<br>
<br>sel      = [sel_comb(:);sel_other(:)]; <br><br>...and indexes into newgrad.chanpos.  As above, newgrad.chanpos is 102x3, but sel is 204x1: 102 combined gradiometers ('sel_comb') plus 102 magnetometers ('sel_other').  There is therefore a dimension mismatch, because the different channel types are 'overlaid' in 'chanpos' but not in 'sel'.<br>
<br>Have I set up my .chanpos, .chanori incorrectly?<br><br>Thanks for any tips,<br>George<br>