Info

This question is closed. Reopen it to edit or answer.

How can I make the model remember and continue on a specific out-variable in the next loop?

2 views (last 30 days)
I am trying to simulate an insect and want to include overwintering individuals which continues their development next spring.
It is a degree day (DD) model and e.g. two is a stage in the insect-development.
if checktwo>0
two=NaN;
twob=NaN;
fif=NaN;
else
fif=find(DD>=882,1,'first');
GDD_fif=(DD(fif,1));
end
if isempty(fif)
fif=NaN;
fifdev= 882-(DD(365,1));
end
So, what I would like to do now is to somehow make the model save the fif - as far as it has reached, and continue the next year (when the loop runs again).
I have gotten as far as including a new output-variable, fifdev, which is the degree days needed for the fif to develop (882) minus the actual accumulated degree days at the end of the year (DD(365,1)).
Does anyone know how to make the model continue the next loop from where fif stopped in the previous one, as well as calculating the next loop's fif?
Hope it makes sense.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!