title: MATLAB Canny edge detection: Maximum recursion limit of 500 reached
body: <p>i'm getting this error </p>
  
  <blockquote>
    <p>Maximum recursion limit of 500 reached</p>
  </blockquote>
  
  <p>as I try to execute the function <code>edge(img,'canny')</code>.<br>
  Fun fact is that the function is called within a script which worked til now (and now it doesn't).</p>
  
  <p>I tried to increase the maximum iteration number ( <code>set(0,'RecursionLimit,value)</code> ) but if I try values too low it appears the same error, if I try values too high the system crashes.</p>
  
  <p>What can I do?</p>
  
  <p>--Update--</p>
  
  <p>I tried to executed the edge() function without specifying 'canny'... This way it works, but I absolutely need the canny edge method!!</p>
  
  <p>--Update--</p>
  
  <p>It also works with the 'sobel' method. Could the problem be on 'canny'?</p>
  
  <p>--Update--</p>
  
  <p>Solved! The problem was a function I created this morning named "gradient" which overriden the function "gradient" called by the Canny Edge detector method</p>