octave-maintainers
[Top][All Lists]
Advanced

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

Code after sub-functions?


From: Michael Goffioul
Subject: Code after sub-functions?
Date: Fri, 24 Aug 2007 15:41:13 +0200

Hi,

Is it legal to have code after subfunctions declaration? This works
under Matlab:

--
function f1
  disp('hello from f1');

function sub1
  disp('hello from sub1');
end

function sub2
  disp('hello from sub2');
end

  disp('hello from f1 gain');
end

function sub3
  disp('hello from sub3');
end
--

Matlab prints:

hello from test1
hello from test1 again

While octave only prints:
hello from test1

In other words, it doesn't execute the code after the subfunction declarations.

Note: this kind of code is generated by the GUI editor of Matlab, so it *may*
happen.

Michael.


reply via email to

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