title: Octave GNU: Undefined variable 'x' , even though it's defined as function input
body: <p>just trying to write a simple program to find the gcd of n numbers. I have no clue how to fix this error, i've read all of octaves function documentation and tried to find questions like this ... Just started programming in Octave btw.
  Here's the code:</p>
  <pre><code>function divisor = gcd(x, y)
    q=0;
    r=0;
    l=0;
    h=0;
    if(x&gt;y)
      h=x;
      l=y;
   elseif(x&lt;y) 
      h=y;
      l=x;
   else
      h=y;
      l=x;
   endif 
   while(r != 0)
      q=floor(h/l);
      r = h-l*q;
      q=h;
      r=l;
   endwhile
   divisor = q;
   printf(&quot;%d&quot;, q);
   return;
  endfunction
  </code></pre>
  <p>The Error:</p>
  <pre><code>error: 'x' undefined near line 6 column 6
  error: called from
       gcd at line 6 column 3
  </code></pre>