フィルターのクリア

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 Center および File ExchangeProgramming についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by