title: Change all negative values to positive values of the same magnitude (MATLAB)
body: <p>I have a matrix of negative and positive values, I've tried using an if loop to change the negative ones to positive:</p>
  
  <pre><code>if A(A&lt;0)
      A = A.*(-1);
  end
  </code></pre>
  
  <p>but it doesn't seem to do anything, what do?</p>