title: How do vectors as inputs work in interpreted matlab function block in Simulink?
body: <p>I have this function writen in matlab: </p>
  
  <pre><code>function out = summa(in1,in2)
  out = in1(1)+ in1(2)+ in1(3)+ in1(4)+ in1(5)+ in1(6)+ in2(1)+ in2(2)+ in2(3)
  </code></pre>
  
  <p>And I've implemented it in simulink as follows: </p>
  
  <p><img src="https://i.stack.imgur.com/01wlu.png" alt="Simulink diagram"></p>
  
  <p>And inside the matlab function block I've writen </p>
  
  <pre><code>summ(u(1),u(2))
  </code></pre>
  
  <p>I get the following error:</p>
  
  <p><img src="https://i.stack.imgur.com/iBqeQ.png" alt="Simulink Error"></p>
  
  <p>The function works fine if I input the vectors from the console, as follows:</p>
  
  <pre><code>summa([1 2 3 4 5 6],[1 2 3])
  </code></pre>
  
  <p>I get 27 as output</p>
  
  <p>What am I doing wrong? I have a feeling the mux does not work like I want it to or that the arguments to the block are incorrect.</p>