title: Avoid division by zero between matrices in MATLAB
body: <p>I'm using matlab and I have two matrices :</p>
  
  <pre><code>G =
  
   1     1     1     1
   1     1     1     1
  </code></pre>
  
  <p>and the scond:</p>
  
  <pre><code>m =
  
   4     4     4     4
   0     0     0     0
  </code></pre>
  
  <p>I want this result : </p>
  
  <pre><code>x =
  
   1/4     1/4     1/4     1/4
    0       0       0       0
  </code></pre>
  
  <p>What I did so far is this : </p>
  
  <pre><code>x = G ./ m
  </code></pre>
  
  <p>But it returns : </p>
  
  <pre><code>x =
  
   1/4     1/4     1/4     1/4
   NaN     NaN     NaN     NaN
  </code></pre>
  
  <p>How can I avoid the divison by zero by placing a default value "0" if there is a division by zero ?</p>