I'm running into an error while attempting to setup a configuration structure for a single subjects EEG data using Fieldtrip. While I think the answer is plain, I am unable to figure out for the life of me.
My code loads one subjects EEG data and setups the channels, structure and electrode positions as such:
% Prepare layout
cfglay = [];
locsall = EEG_loc.chanlocs;
elec.pos = [locsall.X;locsall.Y;locsall.Z]';
elec.label = {locsall.labels};
cfglay.elec = elec;
cfglay.skipscale = 'yes';
cfglay.skipcomnt = 'yes';
layout = ft_prepare_layout(cfglay);
However, the variable lab does not seem to be captured. I know it pertains to labeling of the electrode positions
elec.pos = [locsall.X;locsall.Y;locsall.Z]';
Unrecognized function or variable 'lab'.
Error in channelposition (line 348)
n = size(lab,2);
^^^
Error in ft_datatype_sens (line 379)
[chanpos, chanori, lab] = channelposition(sens);
^^^^^^^^^^^^^^^^^^^^^
Error in ft_datatype_sens (line 181)
sens = ft_datatype_sens(sens, 'version', '2011v2');
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in ft_datatype_sens (line 163)
sens = ft_datatype_sens(sens, new_argin{:});
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in ft_checkconfig (line 251)
cfg.elec = ft_datatype_sens(struct(cfg.elec));
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in ft_prepare_layout (line 160)
cfg = ft_checkconfig(cfg, 'renamed', {'elecfile', 'elec'});
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in MVPA_test_1 (line 107)
layout = ft_prepare_layout(cfglay);
^^^^^^^^^^^^^^^^^^^^^^^^^
But I'm not too sure what the correct variable definition is.
Brentspine
1,0321 gold badge13 silver badges26 bronze badges
lang-matlab