<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Dear Quentin,</p>
    <p>please change the line:<br>
    </p>
    <p>num_elecs = 2;</p>
    <p>to <br>
    </p>
    <p>num_elecs = 1;</p>
    <p>then it will work.</p>
    <p><br>
    </p>
    <p>by num_elecs = 2, you specify that the tDCS simulation is added
      as simulation number 2 (i.e. s.poslist{2}) which SimNIBS should
      run:</p>
    <p>% Initialize a tDCS simulation<br>
      s.poslist{num_elecs} = sim_struct('TDCSLIST');<br>
      % Set currents<br>
      s.poslist{num_elecs}.currents = [1e-3 -1e-3];</p>
    <p>...<br>
    </p>
    <p>However, as there is no simulation number 1 (s.poslist{1} remains
      empty), SimNIBS complains. I guess you defined the TMS simulation
      as simulation number 1, so that it then worked.<br>
    </p>
    <p>Best,</p>
    <p>Axel<br>
    </p>
    <p><br>
    </p>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 3/30/2022 5:19 PM, Quentin
      Mesnildrey wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:0919a799-bbe6-9b2d-8f2f-1456eda3bf5f@corstim.com">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      Dear all,<br>
      <br>
      please find the very basic simulation I tried to run and the
      associated error message. <br>
      <br>
      Note that the same code works when I add a TMS section. <br>
      <br>
      Best<br>
      <br>
      Quentin<br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <div class="moz-cite-prefix">Le 29/03/2022 à 09:44, Axel
        Thielscher a écrit :<br>
      </div>
      <blockquote type="cite"
        cite="mid:6631f2e5-2b2d-e4fa-e19d-24fb37c2ae3a@drcmr.dk">Dear
        Quentin, <br>
        <br>
        can you please send the matlab script where the error occured? <br>
        <br>
        Best, <br>
        <br>
        Axel <br>
        <br>
        <br>
        On 3/25/2022 4:54 PM, Quentin Mesnildrey wrote: <br>
        <blockquote type="cite">Dear community, <br>
          <br>
          I am just beginning to run simulations using simnibs so I
          apologize in advance if my question has been answered in the
          past. If so, please redirect me to a previous discussion. <br>
          <br>
          I have managed to run tDCS simulation using the GUI. My next
          step is to run it using matlab scripts. I started using the
          tutorial script provided on the website. Everything seems to
          work well when I do not change anything but when I remove the
          TMS component (which I am not interested in), I end up with
          the following error message : <br>
          <br>
          ************** <br>
          if PL['type'][0] == 'TMSLIST': <br>
          IndexError: only integers, slices (`:`), ellipsis (`...`),
          numpy.newaxis (`None`) and integer or boolean arrays are <br>
          valid indices <br>
          ************** <br>
          Which seems to indicate that not having the TMS is
          problematic. <br>
          <br>
          I would deeply appriciate any advice on this (beginner) issue.
          <br>
          <br>
          Best regards, <br>
          <br>
        </blockquote>
      </blockquote>
      <br>
      <div class="moz-signature">-- <br>
        <meta http-equiv="content-type" content="text/html;
          charset=UTF-8">
        <title></title>
        Quentin Mesnildrey<br>
        Chef de projet R&D  - CorStim<br>
        <a class="moz-txt-link-abbreviated moz-txt-link-freetext"
          href="mailto:quentin.mesnildrey@corstim.com"
          moz-do-not-send="true">quentin.mesnildrey@corstim.com</a><br>
        +33688875685<br>
        <img src="cid:part1.8CZzRdL0.Mtrhuz5j@drcmr.dk" alt="" class=""
          width="195" height="47"> </div>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
Dr. Axel Thielscher
Professor of Neurophysics and Neuroimaging
Danish Research Center for Magnetic Resonance
Copenhagen University Hospital Hvidovre
DK-2650 Hvidovre, Denmark
<a class="moz-txt-link-abbreviated" href="http://www.drcmr.dk">www.drcmr.dk</a>
&
Department of Health Technology
Technical University of Denmark
DK-2800 Kgs. Lyngby
<a class="moz-txt-link-freetext" href="http://www.healthtech.dtu.dk/">http://www.healthtech.dtu.dk/</a></pre>
  </body>
</html>