|
From: | Doug Stewart |
Subject: | Re: using a global variable as default argument |
Date: | Sun, 23 Mar 2014 12:47:18 -0400 |
Darn. Another typo. Sorry, I'm hazy today.
Once more corrected.rv = v;
Erik Leunissen.
--
-- script file tst.m --
function rv = f(v=pi)
endfunction
--
> tst
> f()
ans = 3.1416
OK, that works. However, the following doesn't:
-- script file tst.m --
global myconst = 1.2345;
function rv = f()
rv=v;
endfunction
--
> tst
> f()
error: 'myconst' undefined near line 3 column 19
_______________________________________________
Help-octave mailing list
address@hidden
https://mailman.cae.wisc.edu/listinfo/help-octave
[Prev in Thread] | Current Thread | [Next in Thread] |