For long run simulations, there is a chance the simulations might stop prematurely after running for a week.
tspan = [0 500];
sol = dde23(@ddefun, lags, @history, tspan);
In that case, if the simulation ends prematurely before t = 500, the above code doesn't return anything. Is there an efficient way to keep saving/outputing the sol at every value of eg., tf = [50, 100, 150...500] so that if the simulation stops, still I can use the sol values saved until that point to restart the simulation