title: How to do element-wise calculation on all element pairs
body: <p>a=[4 2 5 9]</p>
  
  <p>The I have to write a code using for loop to get the following vector:</p>
  
  <p>[4-2 4-5 4-9 2-5 2-9 5-9]</p>
  
  <p>How can I do this in MATLAB?</p>