Dear All,
how can we update the variable s in loop in Julia?
un = zeros(Float64,3,1)
an1 = zeros(Float64,3,1)
for n in 1 : 3
an1 = un
un = an1
end
ERROR: LoadError: UndefVarError: un not defined
I know that the solution is add global to un (
global un = an1
),
but is there another method that we can use to fix this bug in Julia 1.1.0?
Best