help-octave
[Top][All Lists]
Advanced

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

Re: using a global variable as default argument


From: Erik Leunissen
Subject: Re: using a global variable as default argument
Date: Mon, 24 Mar 2014 09:48:52 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0

On 03/23/2014 05:47 PM, Doug Stewart wrote:

## try this:

function rv = f()

        global myconst;
         v=myconst;

    rv=v;

endfunction
--


Like that, I lose the default vs. user-supplied duality, right?

Thanks for the suggestion though. It makes me realize that I can have the same functionality by tweaking the code inside the function.

Erik.


reply via email to

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