title: Erro:Edge vector must be monotonically non-decreasing
body: <p>My issue is with MCsolutionupdated() function in that I am unable to run it for 20,000+ iterations as I obtain the error "Edge vector must be monotonically non-decreasing.". Sometimes, I even obtain Inf elements (when I do not get this error) for final_matrix which does not make sense either. When I run Nielsennewupdated(casechoice, no_iterations) I am able to run it for as many simulations and I do not ever obtain Inf elements. So, I think there must be a problem with MCsolutionupdated().</p>
  
  <pre><code>function [final_matrix, thresh_strain] = MCsolutionupdated()
  
  no_iterations = input('No. of iterations?:');
  
  thresh_strain = zeros(1,no_iterations*16);
  
  casechoice =input('Enter 1 for 1st Layup and 2 for 2nd layup:');
  
   J = Nielsennewupdated(casechoice, no_iterations);
   thresh_strain = J;
  
  
  roundedValues = round(thresh_strain/.0001)*0.0001;
  myUniqueValues = unique(roundedValues);
  i = numel(myUniqueValues);
  nelements  = hist(thresh_strain(:),myUniqueValues); 
  
  for i=1:i
      percent(i)  = (nelements(1,i)/numel(thresh_strain))*100;
  end
  
  final_matrix = [myUniqueValues' percent'];
  
  % uniqueValues,~,uniqueIndex] = unique(ans);
  % frequency = accumarray(uniqueIndex(:),1)./numel(ans);
  
  header = {'Threshold Strain' 'Probability of occurrence'};
  xlswrite('results.xlsx', header) 
  xlswrite('results.xlsx', final_matrix,'A2')
  </code></pre>
  
  <p>Thanks</p>