help-octave
[Top][All Lists]
Advanced

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

Re: nested functions?


From: Vic Norton
Subject: Re: nested functions?
Date: Tue, 18 Feb 2014 19:42:00 -0500

On Feb 18, 2014, at 5:39 PM, Mike Miller <address@hidden> wrote:

> On Tue, Feb 18, 2014 at 16:28:35 -0500, Benjamin Abbott wrote:
>> Matlab doesn't support function functions defined at the command line or in 
>> scripts (only in function files)
> 
> Ah yes, thanks Ben. So there is no Matlab compatibility to compare
> with here, having a script that defines a function at all is an Octave
> extension.
> 
> So back to your original script Vic, the strict answer is that your
> script is not compatible with Matlab, therefore your use of nested
> functions in that way is not supported :)
> 
> However, I notice that functions defined at the command line in Octave
> *do* support nested functions. So if you eval or paste the contents of
> the script at the command line, it should work. So a case could still
> be made for supporting nested functions in Octave everywhere that
> ordinary functions are supported.
> 
> -- 
> mike

Thanks for the analysis, Mike. I think I'll avoid nested functions for the
time being. I would like to be able load a bunch of functions with a
a command like "XXfunctions". This works now, in any version of
Octave, provided none of the functions contains a nested function.

Regards,

Vic

reply via email to

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