<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi Raphaël,<br></div><div dir="ltr">Many thanks for your answer. In the end it was a stupid error! What worked was to load the mat file of the layout, change the cfg.layout and get rid of cfg.elec. I upload my code fixed in case anyone else faces the same problem:<br><br>%load layout<br>load('C:\Program Files\MATLAB\fieldtrip20181107\template\layout\acticap-64ch-standard2.mat')</div><div dir="ltr">%prepare neighbours<br>cfg = [];<br>cfg.method = 'triangulation';<br>cfg.channel = 'all';<br>cfg.layout = lay;<br>cfg.feedback ='yes';<br>neighbours = ft_prepare_neighbours(cfg, data_ica_cleaned);<br><br></div><div dir="ltr">% interpolate noisy channels<br>cfg = [];<br>cfg.badchannel = {'Fp1';'F7';'F8';'C6';'TP8';'P8';'FT10'};<br>cfg.method = 'weighted';<br>cfg.neighbours = neighbours;<br>cfg.layout = lay;<br>interpolated_data = ft_channelrepair(cfg,data_ica_cleaned);<br><br>Best,<br>Iris<br></div></div><br><div class="gmail_quote"><div class="gmail_attr" dir="ltr">Missatge de Raphaël Thézé <<a href="mailto:raphael.theze@gmail.com" target="_blank">raphael.theze@gmail.com</a>> del dia dv., 3 de maig 2019 a les 17:20:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid"><div dir="ltr">Hi Iris, <div><br></div><div>Have your tried to put in your cfg for ft_channelrepair:</div><div>cfg.elec = ft_read_sens( 'acticap-64ch-standard2.mat');</div><div><br></div><div>If that does not work, maybe your electrode file is the problem.</div><div><br></div><div>Cheers, </div><div>Raphaël </div><div> </div></div><br><div class="gmail_quote"><div class="gmail_attr" dir="ltr">Le ven. 3 mai 2019 à 16:35, MILÁN MAILLO, IRIS <<a href="mailto:iris.milan@upf.edu" target="_blank">iris.milan@upf.edu</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Hi everyone,<br>I am trying to interpolate some noisy channels but I keep getting an error I am not able to solve. Here is my code:<br><br>%prepare neighbours<br><span style="font:400 13.33px/19.99px Arial,Helvetica,sans-serif;text-align:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;text-decoration:none;word-spacing:0px;display:inline;white-space:normal;font-size-adjust:none;font-stretch:normal;float:none;background-color:transparent">cfg = [];</span></div><div><span style="font:400 13.33px/19.99px Arial,Helvetica,sans-serif;text-align:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;text-decoration:none;word-spacing:0px;display:inline;white-space:normal;font-size-adjust:none;font-stretch:normal;float:none;background-color:transparent"></span>cfg.method = 'distance';<br>cfg.channel = 'all';<br>cfg.layout = 'acticap-64ch-standard2.mat';<br>cfg.feedback ='yes';<br>neighbours = ft_prepare_neighbours(cfg, data_ica_cleaned);<br><br></div><div>% interpolate noisy channels<br>cfg = [];<br>cfg.badchannel = {'F8','FT9','FT7'};<br>cfg.method = 'weighted';<br>cfg.neighbours = neighbours;<br>cfg.elecfile = 'acticap-64ch-standard2.mat';<br>interpolated_data = ft_channelrepair(cfg,data_ica_cleaned);<br clear="all"><br>And the error I get is this:<br><br>Undefined function or variable 'lab'.</div><div>Error in channelposition (line 331)<br>n = size(lab,2);</div><div>Error in ft_datatype_sens (line 350)<br> [chanpos, chanori, lab] = channelposition(sens);</div><div>Error in ft_datatype_sens (line 158)<br> sens = ft_datatype_sens(sens, 'version', '2011v2');</div><div>Error in ft_read_sens (line 475)<br>sens = ft_datatype_sens(sens);</div><div>Error in ft_fetch_sens (line 150)<br> sens = ft_read_sens(cfg.elecfile);</div><div>Error in ft_channelrepair (line 129)<br> sens = ft_fetch_sens(cfg, data);<br><br><br>I don't know if I'm getting this error because I haven't defined the structure for EEG channels (sens.label, sens.chanpos, sens.elecpos, sens.tra), but I haven't done it because I'm not really sure of how to do it.<br><br>Could anyone help me?<br>Thanks a million!!<br><br></div><div class="gmail-m_6814577409353228866gmail-m_-4056040863325023418gmail-m_-2283465468997423595gmail_signature" dir="ltr"><div dir="ltr"><div><div dir="ltr"><span><b>Iris Milán Maillo</b><br>
<br>
PhD Student<br><a href="https://www.upf.edu/web/spb" target="_blank">Speech Production and Bilingualism (SPB)</a><br>
<a href="http://cbc.upf.edu/cbc.upf.edu/" target="_blank">Center for Brain and Cognition (CBC)</a><br><br>
</span></div></div></div></div></div></div></div></div>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank" rel="noreferrer">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
<a href="https://doi.org/10.1371/journal.pcbi.1002202" target="_blank" rel="noreferrer">https://doi.org/10.1371/journal.pcbi.1002202</a><br>
</blockquote></div>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank" rel="noreferrer">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
<a href="https://doi.org/10.1371/journal.pcbi.1002202" target="_blank" rel="noreferrer">https://doi.org/10.1371/journal.pcbi.1002202</a><br>
</blockquote></div><br clear="all"><br>-- <br><div class="gmail-m_6814577409353228866gmail_signature" dir="ltr"><div dir="ltr"><div><div dir="ltr"><span><b>Iris Milán Maillo</b><br>
<br>
PhD Student<br><a href="https://www.upf.edu/web/spb" target="_blank">Speech Production and Bilingualism (SPB)</a><br>
<a href="http://cbc.upf.edu/cbc.upf.edu/" target="_blank">Center for Brain and Cognition (CBC)</a><br>
<br>
Carrer de Ramon Trias Fargas, 25-27, 08005 Barcelona | Edifici Merce Rodoreda, (room 24.311)<br>
</span></div></div></div></div></div></div>