<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div class="">You are not using the most recent fieldtrip code. See attached screenshot for a section of ft_checkconfig (which I took from
<a href="https://github.com/fieldtrip/fieldtrip" class="">https://github.com/fieldtrip/fieldtrip</a> (utilities/ft_checkconfig.m)</div>
<div class=""><br class="">
</div>
<div class="">The error message in your earlier e-mail pointed to line 529.</div>
<div class=""><br class="">
</div>
<div class="">Jan-Mathijs</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<img apple-inline="yes" id="003AA382-A9C4-40A1-8904-90842654B1E4" width="814" height="515" src="cid:9C687774-46FE-4580-B3F5-6F066637A696@dccn.nl" class=""><br class="">
<div>
<blockquote type="cite" class="">
<div class="">On 22 May 2019, at 09:42, Irene Varela Leniz <<a href="mailto:irene.varela@alumni.mondragon.edu" class="">irene.varela@alumni.mondragon.edu</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Dear Shoffelen, </div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br class="">
</div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif">I am working with last Fieldtrip and MATLAB version so I'm afraid that's not the problem.</div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br class="">
</div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Best wishes, </div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br class="">
</div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Irene</div>
</div>
<br class="">
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">El mié., 22 may. 2019 a las 9:38, Schoffelen, J.M. (Jan Mathijs) (<<a href="mailto:jan.schoffelen@donders.ru.nl" class="">jan.schoffelen@donders.ru.nl</a>>) escribió:<br class="">
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div style="overflow-wrap: break-word;" class="">Hi Irene,
<div class=""><br class="">
</div>
<div class="">Please check which version of the code you are using, and update to a more recent version to FieldTrip, and try again. The line + error you report does not match the ones in the current version of Fieldtrip.</div>
<div class=""><br class="">
</div>
<div class="">Best wishes,</div>
<div class="">Jan-Mathijs</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
<div class="">
<div class="">
<blockquote type="cite" class="">
<div class="">On 22 May 2019, at 09:21, Irene Varela Leniz <<a href="mailto:irene.varela@alumni.mondragon.edu" target="_blank" class="">irene.varela@alumni.mondragon.edu</a>> wrote:</div>
<br class="gmail-m_-2232218543815307315Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Dear Fieldtripers, </div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br class="">
</div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif">I am trying to replicate the well-known
<i class="">tutorial:salzburg [FielTrip] (</i><a href="http://old.fieldtriptoolbox.org/tutorial/salzburg" style="font-family:Arial,Helvetica,sans-serif" target="_blank" class="">http://old.fieldtriptoolbox.org/tutorial/salzburg</a>). Anyway, I am getting some
 errors that I could not manage to solve. I would be really grateful if someone could lend me a hand<span style="color:rgb(60,60,60);font-family:Arial,sans-serif" class="">.</span></div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><span style="color:rgb(60,60,60);font-family:Arial,sans-serif" class=""><br class="">
</span></div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><span style="color:rgb(60,60,60);font-family:Arial,sans-serif" class="">I am working on section called "</span><span style="font-family:arial,sans-serif;color:rgb(45,45,45)" class="">Localizing
 auditory evoked fields using beamforming techniques in parceled brain space". </span><span style="font-family:Arial,Helvetica,sans-serif" class="">I managed to compute the
<i class="">sourcemode</i>l as explained in the tutorial without any problem. But now, when "Computing the leadfield" I get an error message related with
<i class="">sourcemodel.inside </i>field, </span><span style="font-family:Arial,Helvetica,sans-serif" class="">which makes it impossible for me to create the leadfield. The structure is the following:</span></div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><span style="font-family:Arial,Helvetica,sans-serif" class=""><br class="">
</span></div>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class="">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class="">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class="">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i class=""><font size="1" class="">sourcemodel =
</font></i></div>
</blockquote>
</blockquote>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class="">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class="">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i class=""><font size="1" class="">  struct with fields:</font></i></div>
</blockquote>
</blockquote>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class="">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class="">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i class=""><font size="1" class="">       pos: [6426×3 double]</font></i></div>
</blockquote>
</blockquote>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class="">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class="">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i class=""><font size="1" class="">       dim: [17 21 18]</font></i></div>
</blockquote>
</blockquote>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class="">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class="">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i class=""><font size="1" class="">      unit: 'm'</font></i></div>
</blockquote>
</blockquote>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class="">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class="">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i class=""><font size="1" class="">    inside: [17×21×18 logical]</font></i></div>
</blockquote>
</blockquote>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class="">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class="">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i class=""><font size="1" class="">       cfg: [1×1 struct]</font></i></div>
</blockquote>
</blockquote>
</blockquote>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><span style="font-family:Arial,Helvetica,sans-serif" class=""><br class="">
</span></div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><span style="font-family:Arial,Helvetica,sans-serif" class="">The structure for computing the leadfield:</span></div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><span style="font-family:Arial,Helvetica,sans-serif" class=""><br class="">
</span></div>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class="">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif">                     <font size="1" class="">
<i class="">  cfg                 = [];<br class="">
                        cfg.label         = data.label;<br class="">
                        cfg.elec          = data.elec;<br class="">
                        cfg.vol         = hdm;<br class="">
                        cfg.lcmv.reducerank = 2; % I am working with EEG data<br class="">
                        cfg.grid = sourcemodel;<br class="">
                        [grid] = ft_prepare_leadfield(cfg)</i></font></div>
</blockquote>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><span style="font-family:Arial,Helvetica,sans-serif" class=""><br class="">
</span></div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><span style="font-family:Arial,Helvetica,sans-serif" class="">An the error I get:</span></div>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class="">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class="">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class="">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><span style="font-family:Arial,Helvetica,sans-serif" class=""><font color="#ff0000" size="1" class=""><br class="">
</font></span></div>
</blockquote>
</blockquote>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class="">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class="">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font color="#ff0000" size="1" class="">Operands to the || and && operators must be convertible to logical scalar values.</font></div>
</blockquote>
</blockquote>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class="">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class="">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font color="#ff0000" size="1" class=""><br class="">
</font></div>
</blockquote>
</blockquote>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class="">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class="">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font color="#ff0000" size="1" class="">Error in ft_checkconfig (line 529)</font></div>
</blockquote>
</blockquote>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class="">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class="">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font color="#ff0000" size="1" class="">  elseif isfield(cfg, 'grid') && isfield(cfg.grid, 'inside') && any(cfg.grid.inside>1)</font></div>
</blockquote>
</blockquote>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class="">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class="">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font color="#ff0000" size="1" class=""><br class="">
</font></div>
</blockquote>
</blockquote>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class="">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class="">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font color="#ff0000" size="1" class="">Error in ft_prepare_leadfield (line 156)</font></div>
</blockquote>
</blockquote>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class="">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class="">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font color="#ff0000" size="1" class="">cfg = ft_checkconfig(cfg, 'inside2logical', 'yes');</font></div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font color="#ff0000" size="1" class=""><br class="">
</font></div>
</blockquote>
</blockquote>
</blockquote>
<font color="#ff0000" face="arial, helvetica, sans-serif" size="1" class=""><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"></span></font>I think the error comes from the fact that
<i class="">source<span class="gmail_default" style="font-family:arial,helvetica,sans-serif">model</span>.inside</i> is a 3-dimensional logical array<span class="gmail_default" style="font-family:arial,helvetica,sans-serif">. The operation -
<span style="color:rgb(255,0,0);font-size:x-small" class="">any(cfg.grid.inside>1)</span>   does not output a logical scalar value because<i class=""> sourcemodel.inside</i> is in 3 dimensions. </span>
<div class=""><span class="gmail_default" style="font-family:arial,helvetica,sans-serif">So far I have always worked with models whose inside parameter was of one dimension. Anyway, I'm not sure if this is the problem, please correct me if I'm wrong.</span><font color="#ff0000" face="arial, helvetica, sans-serif" size="1" class=""><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"></span><br class="">
</font></div>
<div class=""><font color="#ff0000" face="arial, helvetica, sans-serif" size="1" class=""><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br class="">
</span></font></div>
<div class=""><span style="font-family:arial,helvetica,sans-serif" class="">Has anyone encountered this same problem, and does anyone know how to fix it?</span>  <font color="#ff0000" face="arial, helvetica, sans-serif" size="1" class=""><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br class="">
</span></font></div>
<div class=""><font color="#ff0000" face="arial, helvetica, sans-serif" size="1" class=""><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br class="">
</span></font></div>
<div class=""><font face="arial, helvetica, sans-serif" class=""><span class="gmail_default" style="font-family:arial,helvetica,sans-serif">Thank you very much for your attention, </span></font></div>
<div class=""><font face="arial, helvetica, sans-serif" class=""><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br class="">
</span></font></div>
<div class=""><font face="arial, helvetica, sans-serif" class=""><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br class="">
</span></font></div>
<div class=""><font face="arial, helvetica, sans-serif" class=""><span class="gmail_default" style="font-family:arial,helvetica,sans-serif">Irene</span></font></div>
<div class=""><font color="#ff0000" face="arial, helvetica, sans-serif" size="1" class=""><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br class="">
</span></font></div>
<div class=""><font color="#ff0000" face="arial, helvetica, sans-serif" size="1" class=""><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br class="">
</span></font></div>
</div>
_______________________________________________<br class="">
fieldtrip mailing list<br class="">
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="">
<a href="https://doi.org/10.1371/journal.pcbi.1002202" target="_blank" class="">https://doi.org/10.1371/journal.pcbi.1002202</a><br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</div>
_______________________________________________<br class="">
fieldtrip mailing list<br class="">
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="">
<a href="https://doi.org/10.1371/journal.pcbi.1002202" rel="noreferrer" target="_blank" class="">https://doi.org/10.1371/journal.pcbi.1002202</a><br class="">
</blockquote>
</div>
_______________________________________________<br class="">
fieldtrip mailing list<br class="">
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="">
https://doi.org/10.1371/journal.pcbi.1002202<br class="">
</div>
</blockquote>
</div>
<br class="">
</body>
</html>