title: Matlab Error: "Undefined function or method X for input arguments of type 'double'" With Recursion
body: <p>I'm trying to make Sierpinski triangles with recursion but I get this error:</p>
  
  <pre><code>??? Undefined function or method 'sierpinski' for input arguments of type 'double'.
  </code></pre>
  
  <p>I understand that it has to do with Matlab not finding the path for my function, but the weird thing is that it can find my main sierpinski(x,y,n)-function but not the same function that I'm trying to call later in order to get recursion.</p>
  
  <p>My code looks something like this:</p>
  
  <pre><code>function sierpinski(x,y,n)
  ...
  sierpinski(x2,y2,n-1)
  end
  sierpinski([0,1,0.5],[0,0,1],4)
  </code></pre>
  
  <p>I would be very grateful if someone could help me with this :)</p>