title: Subtracting each element of A from every element of B
body: <p>Suppose I have two matrices A and B where:
  A is 100x2
  B is 5x2</p>
  
  <p>I want to subtract each element of A by every element in B. I can run the following to get to achieve what I want:
  <code></p>
  
  <pre><code>for j = 1:5
      D = A - B(j, :);
      C = [C(:,:); D(:,:)];
  end;
  </code></pre>
  
  <p></code>
  However this is slow with huge matrices. All my attempts to vectorize this is met with an error of "nonconformant arguments"
  <code></p>
  
  <pre><code>j = 1:5;
  C = A - B(j, :);
  </code></pre>
  
  <p></code>
  How can I condense the above for loop to make use of vectorization?</p>