title: Convert a for loop into a vector (vectorization)
body: <p>For those super experts out there, I was wondering if you see a quick way to convert the following "for" loop into a one-line vector calculation that is more efficient.</p>
  
  <pre><code>%Define:
  %A size (n,1)
  %B size (n,m)
  %C size (n,1)
  
  B = [2 200; 3 300; 4 400];
  C = [1;2;1];
  
  for j=1:n
       A(j) = B( j, C(j) );
  end
  </code></pre>
  
  <p>So to be clear, is there any alternative way to express A, as a function of B and C, without having to write a loop?</p>