title: Index of elements
body: <p>I have the following <code>for-loop</code> part of a function:</p>
  
  <pre><code>for i=1:5
  for j=1:2
  m=x(i)-c(j);
  end
  end
  </code></pre>
  
  <p>As a call to the function which includes the code above, I pass <code>two</code> values for <code>c</code>. Say the values passed are <code>(3,5)</code> for <code>c1</code> and <code>c2</code> respectively.</p>
  
  <p>As you see in the <code>for-loop</code> above, I will have a two values for <code>c</code>, nanely, <code>c(1)</code> and <code>c(2)</code>.</p>
  
  <p>For the <code>3</code> and <code>5</code> values I have above, how can I assign them to <code>c(1)</code> and <code>c(2)</code> respectively?</p>
  
  <p>When I did the following for instance:</p>
  
  <pre><code>c(1)=center1;
  c(2)=center2;
  </code></pre>
  
  <p>where <code>center1</code> and <code>center2</code> represent the passed value to the function, I got the following error:</p>
  
  <pre><code>In an assignment  A(I) = B, the number of elements in B and I must be
  the same.
  
  Error in functionName (line 32)
      c(1)=center1;
  </code></pre>