About saving output at specific time steps with an ODE solver
이전 댓글 표시
Hi there,
I am running matlab ODE function and saving the integrated solution in a file. Each file comes out to be around 1 GB. I do not need the solution (output) barring at a few times during the run. Is there a way to save only these times and the respective output instead of output at each time step? I have an idea of trying to save the output by using a for loop after every run e.g.
T_out=[0 10 20 30...] ; %...time vector of steps at which output needs to b saved
[T out] = ode15s(....); for i-1:length(T_out) if(T==T_out)
save out to file end....
But this takes a lot of time given that there are at times 100000 time steps in the solver output. Is there a faster way to do this ?
Thanks
답변 (2개)
Jan
2012년 12월 19일
How do you define the input TSPAN for the ODE45 command? Would this help already:
[T, out] = ode15s(@fcn, T_out, y0)
If not, please explain the problem again. Why do you call a FOR loop and how does it look exactly?
카테고리
도움말 센터 및 File Exchange에서 Programming에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!