필터 지우기
필터 지우기

ODE45: only save the solution at final time

조회 수: 6 (최근 30일)
Sidafa
Sidafa 2017년 5월 10일
댓글: Priodyuti Pradhan 2020년 12월 12일
I would like to only save the solution at the final time. Rather than the output argument "y" being an array of size (N, M), I only want to save the last row (which would correspond to the solution at tf).
I would like to avoid the following error:
Requested 442368x1828 (6.0GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to
become unresponsive. See array size limit or preference panel for more information.
Error in ode45 (line 428)
yout = [yout, zeros(neq,chunk,dataType)];
Thank you so much in advance.

답변 (1개)

Jan
Jan 2017년 5월 11일
You can request the output of 3 time steps:
tspan = [ti, (ti+tf) / 2, tf];
Then ignore the first two outputs.

카테고리

Help CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by