title: Adding elements in array in Matlab
body: <p>I have to add elements in array.</p>
  
  <p>I have function:</p>
  
  <pre><code> function d = kronDel(j,k)
  
  if j == k
      d = 1;
  else
      d = 0;
  end
  </code></pre>
  
  <p>And i have n=0:31.</p>
  
  <p>I tried this:</p>
  
  <pre><code>x2=j*kronDel(n-2,0);
  </code></pre>
  
  <p>Why doesnt this work?</p>
  
  <p>I only get x2=0;</p>