This is a question regarding the use of “=” signs in Julia.
I can do the following for-loop in MATLAB
for ii = 1 : dt ηp1 = shallowwave1D(ηn,ηm1,r); ηm1 = ηn; ηn = ηp1; end
Can the same be done in Julia? Or will there be some issues with copies where whatever I do to ηn changes ηm1 (see the second statement in the second line of the for-loop)?
Just asking, because this has tripped me up multiple times in Python where I needed to do copying to resolve the issue.
Do I need to do
for ii = 1 : dt ηp1 = shallowwave1D(ηn,ηm1,r); ηm1 = deepcopy(ηn); ηn = deepcopy(ηp1); end
such that they are all independent of each other?