help-octave
[Top][All Lists]
Advanced

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

initialize variable in a function


From: gigiolone123
Subject: initialize variable in a function
Date: Thu, 15 Nov 2018 12:43:41 -0600 (CST)

now i give you a stupid example to understand my problem:

Main Program:

global cc;

cc=(1:2:300);

for i=1 to 50

ret=vv();

endfor



function vv

global cc;

cc(g)=g*2;  ===> how can i initialize g  = 1 ? (only the first time n)
g++;

endfunction


i want to inizialite the variable "g" with 1...
if can't initialize it in a function...i give initialize out it

there is another method? thank 




--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html



reply via email to

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