help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Returning handles to subfunctions


From: Michael Friedlander
Subject: Returning handles to subfunctions
Date: Mon, 10 Mar 2008 18:05:16 -0700

The first function in this file returns a handle to a subfunction:

% -- file addnum.m --
function addfunc = addnum(a)
  addfunc = @(b)adder(a,b);
end
function c = adder(a,b)
  c = a + b;
end
% -- end file

In Matlab, the call

>> y = addnum(1); y(1)
ans =
     2

works, but gives an error in Octave.  Is this expected behavior?

Cheers,
Michael



reply via email to

[Prev in Thread] Current Thread [Next in Thread]