title: function handles in Octave
body: <p>I have a question regarding function(handles) in Octave.
  So, I want to call a function, which accepts two variables and returns two(the implementation is faulty; but not relevant in this case).</p>
  
  <p>According to the documentation this should be quite straightforward:</p>
  
  <blockquote>
    <p>function [ret-list] = name (arg-list)</p>
    
    <p>body</p>
    
    <p>endfunction</p>
  </blockquote>
  
  <p>I'm trying the following:</p>
  
  <pre><code>function two_d_comp = twodcomp 
  twodcomp.twoDperp=@perp;
                   ^
  end
  
  function twoDperp[vmag, vangle]=perp(x,y)
  W = hypot(y,x);
  vmag = y/W;
  vangle = x/y;
  end;
  </code></pre>
  
  <p>I saved the function in a file called twodcomp.m.
  When I call the function as follows:</p>
  
  <pre><code>[X, Y] = twodcomp.twoDperp(1,2)
  </code></pre>
  
  <p>Octave spits out the following:</p>
  
  <pre><code>error: @perp: no function and no method found
  error: called from
  twodcomp at line 2 column 20
  </code></pre>
  
  <p>I managed to remove the error by removing the output arguments vmag and vangle, as follows:</p>
  
  <pre><code>function twoDperp=perp(x,y)
  </code></pre>
  
  <p>But this is obviously not really what I want.
  Do you guys happen to have some pointers as to what I'm doing wrong?</p>
  
  <p>Cheers</p>