<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div dir="ltr"><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></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></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></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Irene</div></div><br><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">jan.schoffelen@donders.ru.nl</a>>) escribió:<br></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;">
Hi Irene,
<div><br>
</div>
<div>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><br>
</div>
<div>Best wishes,</div>
<div>Jan-Mathijs</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
<div>
<div>
<blockquote type="cite">
<div>On 22 May 2019, at 09:21, Irene Varela Leniz <<a href="mailto:irene.varela@alumni.mondragon.edu" target="_blank">irene.varela@alumni.mondragon.edu</a>> wrote:</div>
<br class="gmail-m_-2232218543815307315Apple-interchange-newline">
<div>
<div dir="ltr">
<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>
</div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif">I am trying to replicate the well-known
<i>tutorial:salzburg [FielTrip] (</i><a href="http://old.fieldtriptoolbox.org/tutorial/salzburg" style="font-family:Arial,Helvetica,sans-serif" target="_blank">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">.</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"><br>
</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">I am working on section called "</span><span style="font-family:arial,sans-serif;color:rgb(45,45,45)">Localizing
auditory evoked fields using beamforming techniques in parceled brain space". </span><span style="font-family:Arial,Helvetica,sans-serif">I managed to compute the
<i>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>sourcemodel.inside </i>field, </span><span style="font-family:Arial,Helvetica,sans-serif">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"><br>
</span></div>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i><font size="1">sourcemodel =
</font></i></div>
</blockquote>
</blockquote>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i><font size="1"> struct with fields:</font></i></div>
</blockquote>
</blockquote>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i><font size="1"> pos: [6426×3 double]</font></i></div>
</blockquote>
</blockquote>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i><font size="1"> dim: [17 21 18]</font></i></div>
</blockquote>
</blockquote>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i><font size="1"> unit: 'm'</font></i></div>
</blockquote>
</blockquote>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i><font size="1"> inside: [17×21×18 logical]</font></i></div>
</blockquote>
</blockquote>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i><font size="1"> 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"><br>
</span></div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><span style="font-family:Arial,Helvetica,sans-serif">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"><br>
</span></div>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"> <font size="1">
<i> cfg = [];<br>
cfg.label = data.label;<br>
cfg.elec = data.elec;<br>
cfg.vol = hdm;<br>
cfg.lcmv.reducerank = 2; % I am working with EEG data<br>
cfg.grid = sourcemodel;<br>
[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"><br>
</span></div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><span style="font-family:Arial,Helvetica,sans-serif">An the error I get:</span></div>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><span style="font-family:Arial,Helvetica,sans-serif"><font color="#ff0000" size="1"><br>
</font></span></div>
</blockquote>
</blockquote>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font color="#ff0000" size="1">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">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font color="#ff0000" size="1"><br>
</font></div>
</blockquote>
</blockquote>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font color="#ff0000" size="1">Error in ft_checkconfig (line 529)</font></div>
</blockquote>
</blockquote>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font color="#ff0000" size="1"> 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">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font color="#ff0000" size="1"><br>
</font></div>
</blockquote>
</blockquote>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font color="#ff0000" size="1">Error in ft_prepare_leadfield (line 156)</font></div>
</blockquote>
</blockquote>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font color="#ff0000" size="1">cfg = ft_checkconfig(cfg, 'inside2logical', 'yes');</font></div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font color="#ff0000" size="1"><br>
</font></div>
</blockquote>
</blockquote>
</blockquote>
<font color="#ff0000" face="arial, helvetica, sans-serif" size="1"><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"></span></font>I think the error comes from the fact that
<i>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">any(cfg.grid.inside>1)</span> does not output a logical scalar value because<i> sourcemodel.inside</i> is in 3 dimensions. </span>
<div><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"><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"></span><br>
</font></div>
<div><font color="#ff0000" face="arial, helvetica, sans-serif" size="1"><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br>
</span></font></div>
<div><span style="font-family:arial,helvetica,sans-serif">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"><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br>
</span></font></div>
<div><font color="#ff0000" face="arial, helvetica, sans-serif" size="1"><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br>
</span></font></div>
<div><font face="arial, helvetica, sans-serif"><span class="gmail_default" style="font-family:arial,helvetica,sans-serif">Thank you very much for your attention, </span></font></div>
<div><font face="arial, helvetica, sans-serif"><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br>
</span></font></div>
<div><font face="arial, helvetica, sans-serif"><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br>
</span></font></div>
<div><font face="arial, helvetica, sans-serif"><span class="gmail_default" style="font-family:arial,helvetica,sans-serif">Irene</span></font></div>
<div><font color="#ff0000" face="arial, helvetica, sans-serif" size="1"><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br>
</span></font></div>
<div><font color="#ff0000" face="arial, helvetica, sans-serif" size="1"><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br>
</span></font></div>
</div>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
<a href="https://doi.org/10.1371/journal.pcbi.1002202" target="_blank">https://doi.org/10.1371/journal.pcbi.1002202</a><br>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
<a href="https://doi.org/10.1371/journal.pcbi.1002202" rel="noreferrer" target="_blank">https://doi.org/10.1371/journal.pcbi.1002202</a><br>
</blockquote></div>