<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div style="margin: 0px; padding: 0px; border: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; font-stretch: inherit; line-height: inherit; vertical-align: baseline;" class="">Hello,</div><div style="margin: 0px; padding: 0px; border: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; font-stretch: inherit; line-height: inherit; vertical-align: baseline;" class=""><br aria-hidden="true" class=""></div><div style="margin: 0px; padding: 0px; border: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; font-stretch: inherit; line-height: inherit; vertical-align: baseline;" class="">My name is Arkadij, and I am a research assistant in SELab, the University of Essex in the UK. Currently, I am learning how to pre-process and analyse EEG data. </div><div style="margin: 0px; padding: 0px; border: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; font-stretch: inherit; line-height: inherit; vertical-align: baseline;" class=""><br aria-hidden="true" class=""></div><div style="margin: 0px; padding: 0px; border: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; font-stretch: inherit; line-height: inherit; vertical-align: baseline;" class="">I am having a problem trying to repair a bad channel. The only method I can use from ft_channelrepair is "average". The other options (weighted, spline, slap) lead to an error. So please check the script and an error message:</div><div style="margin: 0px; padding: 0px; border: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; font-stretch: inherit; line-height: inherit; vertical-align: baseline;" class=""><br aria-hidden="true" class=""></div><div style="margin: 0px; padding: 0px; border: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; font-stretch: inherit; line-height: inherit; vertical-align: baseline;" class=""><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class=""><span style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; color: rgb(14, 0, 255);" class="">if </span>rd.repchan(s)</div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class=""><span class="x_Apple-converted-space" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; color: inherit;">            </span>cfg =[];</div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class=""><span class="x_Apple-converted-space" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; color: inherit;">            </span>cfg.channel = {<span style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; color: rgb(170, 4, 249);" class="">'all'</span>, <span style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; color: rgb(170, 4, 249);" class="">'-VEOG'</span>, <span style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; color: rgb(170, 4, 249);" class="">'-HEOG'</span>,<span style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; color: rgb(170, 4, 249);" class="">'-ECG'</span>};</div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class=""><span class="x_Apple-converted-space" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; color: inherit;">            </span>cfg.method = <span style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; color: rgb(170, 4, 249);" class="">'distance'</span>;</div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class=""><span class="x_Apple-converted-space" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; color: inherit;">            </span>cfg.layout = customlay;</div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class=""><span class="x_Apple-converted-space" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; color: inherit;">            </span>neighbours = ft_prepare_neighbours(cfg, data);</div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class=""><span class="x_Apple-converted-space" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; color: inherit;">            </span>cfg =[];</div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class=""><span class="x_Apple-converted-space" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; color: inherit;">            </span>cfg.neighbours = neighbours;</div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class=""><span class="x_Apple-converted-space" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; color: inherit;">            </span>cfg.method = <span style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; color: rgb(170, 4, 249);" class="">'weighted'</span>;<span class="x_Apple-converted-space" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; color: inherit;"> </span></div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class=""><span class="x_Apple-converted-space" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; color: inherit;">            </span>cfg.elec = <span style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; color: rgb(170, 4, 249);" class="">'easycap_custom.mat'</span>;</div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class=""><span class="x_Apple-converted-space" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; color: inherit;">            </span>cfg.senstype = <span style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; color: rgb(170, 4, 249);" class="">'eeg'</span>;</div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class=""><span class="x_Apple-converted-space" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; color: inherit;">            </span>cfg.trials = <span style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; color: rgb(170, 4, 249);" class="">'all'</span>;</div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class=""><span class="x_Apple-converted-space" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; color: inherit;">            </span><span style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; color: rgb(14, 0, 255);" class="">if </span>strcmp (rd.subj,<span style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; color: rgb(170, 4, 249);" class="">'8'</span>), cfg.neighbours(1).label = <span style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; color: rgb(170, 4, 249);" class="">'C2'</span>;<span class="x_Apple-converted-space" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; color: inherit;">  </span>cfg.neighbours(1).neighblabel = {<span style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; color: rgb(170, 4, 249);" class="">'FC2'</span>, <span style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; color: rgb(170, 4, 249);" class="">'C4'</span>,<span style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; color: rgb(170, 4, 249);" class="">'CP2'</span>,<span style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; color: rgb(170, 4, 249);" class="">'Cz'</span>}; cfg.badchannel = {<span style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; color: rgb(170, 4, 249);" class="">'C2'</span>}; <span style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; color: rgb(14, 0, 255);" class="">end</span></div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class=""><span class="x_Apple-converted-space" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; color: inherit;">            </span>data = ft_channelrepair(cfg, data);</div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class=""><span class="x_Apple-converted-space" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; color: inherit;">        </span><span style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; color: rgb(14, 0, 255);" class="">end</span> <span class="x_Apple-converted-space" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; color: inherit;"> </span></div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; min-height: 12px;" class=""><br aria-hidden="true" class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class="">Unable to perform assignment because the size of the left side is 64-by-3 and the size of the right side is 64-by-2.</div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; min-height: 12px;" class=""><br aria-hidden="true" class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class="">Error in ft_datatype_sens (line 454)</div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class=""><span class="x_Apple-converted-space" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; color: inherit;">        </span>sens.chanpos(selsens,:) = chanpos(selpos,:);</div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; min-height: 12px;" class=""><br aria-hidden="true" class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class="">Error in ft_datatype_sens (line 240)</div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class=""><span class="x_Apple-converted-space" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; color: inherit;">    </span>sens<span class="x_Apple-converted-space" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; color: inherit;">      </span>= ft_datatype_sens(sens, new_argin{:});</div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; min-height: 12px;" class=""><br aria-hidden="true" class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class="">Error in ft_datatype_sens (line 207)</div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class=""><span class="x_Apple-converted-space" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; color: inherit;">    </span>sens<span class="x_Apple-converted-space" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; color: inherit;">      </span>= ft_datatype_sens(sens, new_argin{:});</div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; min-height: 12px;" class=""><br aria-hidden="true" class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class="">Error in ft_datatype_sens (line 180)</div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class=""><span class="x_Apple-converted-space" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; color: inherit;">    </span>sens<span class="x_Apple-converted-space" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; color: inherit;">      </span>= ft_datatype_sens(sens, new_argin{:});</div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; min-height: 12px;" class=""><br aria-hidden="true" class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class="">Error in ft_read_sens (line 614)</div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class="">sens = ft_datatype_sens(sens);</div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; min-height: 12px;" class=""><br aria-hidden="true" class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class="">Error in ft_fetch_sens (line 149)</div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class=""><span class="x_Apple-converted-space" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; color: inherit;">  </span>sens = ft_read_sens(cfg.elec, 'senstype', 'eeg');</div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; min-height: 12px;" class=""><br aria-hidden="true" class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class="">Error in ft_channelrepair (line 168)</div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class=""><span class="x_Apple-converted-space" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; color: inherit;">  </span>sens = ft_fetch_sens(cfg, data);</div><br aria-hidden="true" class=""></div><div style="margin: 0px; padding: 0px; border: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; font-stretch: inherit; line-height: inherit; vertical-align: baseline;" class=""><br aria-hidden="true" class=""></div><div style="margin: 0px; padding: 0px; border: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; font-stretch: inherit; line-height: inherit; vertical-align: baseline;" class="">I've followed the error all the way down to the ft_datatype_sens, which says that channels position should be Mx3 structure. However, as I understood, configuration for EEG cap layout is <span style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; color: inherit; background-color: rgb(255, 255, 255);" class="">usually<span class="x_Apple-converted-space" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-size: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; color: inherit;"> done in </span></span>2D. So, my humble interpretation of the error is that ft_datatype_sens requires a 3-column channels position structure (3D?), whereas the layout I am using has only 2 columns (64x2). </div><div style="margin: 0px; padding: 0px; border: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; font-stretch: inherit; line-height: inherit; vertical-align: baseline;" class=""><br aria-hidden="true" class=""></div><div style="margin: 0px; padding: 0px; border: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; font-stretch: inherit; line-height: inherit; vertical-align: baseline;" class="">Also, I've created a 3D layout through ft_prepare_layout and another 3-column layout through Matlab coding, both based on data channel labels. None of these layouts helped to solve an issue. I've got the same error. I am only learning about EEG pre-processing, and maybe the 'average' approach for repairing bad channels would be sufficient. However, even after interpolating with the 'average' approach, the signal of the bad channel looks completely irrelevant. </div><div style="margin: 0px; padding: 0px; border: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; font-stretch: inherit; line-height: inherit; vertical-align: baseline;" class=""><br aria-hidden="true" class=""></div><div style="margin: 0px; padding: 0px; border: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; font-stretch: inherit; line-height: inherit; vertical-align: baseline;" class="">I will appreciate any suggestions about this issue, as well as comments regarding my interpretations. Thank you!</div><div style="margin: 0px; padding: 0px; border: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; font-stretch: inherit; line-height: inherit; vertical-align: baseline;" class=""><br aria-hidden="true" class=""></div><div style="margin: 0px; padding: 0px; border: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; font-stretch: inherit; line-height: inherit; vertical-align: baseline;" class="">with best wishes</div><div style="margin: 0px; padding: 0px; border: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; font-stretch: inherit; line-height: inherit; vertical-align: baseline;" class="">Arkadij</div></body></html>