필터 지우기
필터 지우기

Cell input to ode45 function

조회 수: 3 (최근 30일)
R SIVAKUMAR
R SIVAKUMAR 2022년 8월 27일
편집: R SIVAKUMAR 2022년 8월 27일
Hey Folks!
Please help me out with the problem below.
I've been trying to run a ode45 function that simulates 4 variables simulataneously. one among the 4, by itself has 7 variables inside it.
Like supposed say, I need to simulate this cell, y = {X(t),S(t),P(t),V(t)} where X,P & V are doubles. And S is a vector with values for 7 variables.
i.e. S(t) = [s1(t),s2(t),..,s7(t)].
So, is it by any means possible for me to simulate as below?
y0 = {X(t),S(t),P(t),V(t)} % Initial conditions
[t,y] = ode45(dydt, tspan, y0}
where the resulting "y" is cell output.

채택된 답변

Chunru
Chunru 2022년 8월 27일
You can take all variables as an vector instead of cell array. For example,
y = [X(t), S_1(t), ... S_7(t), P(t), V(t)]'.
Then you need to define dydt accordingly.
ode45 does not support cell input.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by