title: Matlab try/catch
body: <pre><code>for ii = 1:2:2*de.nP            
          G=[one, aux3(:,ii), aux3(:,ii) - aux2(:,ii),aux3(:,ii+1) - aux2(:,ii+1)];
  
          try
          betasPu(:,(ii+1)/2) =G\yM;
          catch ME
           betasPu(:,(ii+1)/2)=[Inf,Inf,Inf,Inf];
          end 
  end
  </code></pre>
  
  <p>I am using the code above to try and catch instances when the G used in G\yM; is badly conditioned/singular.</p>
  
  <p>I have used the code above but right now the catch does not seem to be triggering despite several badly conditioned/singular matrices being produced.</p>