フィルターのクリア

not enough input arguments, odes

1 回表示 (過去 30 日間)
pari
pari 2022 年 7 月 18 日
コメント済み: Sam Chak 2022 年 7 月 18 日
Hi everyone
I've used a simple form of ode function, but keep getting this error.
can anyone help me please?
Here is my code:
function xdoubledot=odes(t,x,m1, m2 ,k1, k2, k3, c1, c2, c3 )
xdoubledot=zeros(4,1);
xdoubledot(1)=x(3);
xdoubledot(2)=x(4);
xdoubledot(3)=1/m1*(-(k1+k2)*x(1)+k2*x(2)-(c1+c2)*x(3)+c(2)*x(4));
xdoubledot(4)=1/m2*(k2*x(1)-(k2+k3)*x(2)+c2*x(3)-(c2+c3)*x(4));
end
  3 件のコメント
pari
pari 2022 年 7 月 18 日
I've got them from the user before
Sam Chak
Sam Chak 2022 年 7 月 18 日
I guess you saved/placed the parameters in another m-file, but you forgot to call it.

サインインしてコメントする。

回答 (1 件)

Jan
Jan 2022 年 7 月 18 日
k1 = rand;
k2 = 18;
etc = 21.7;
... and so on
[t,x] = ode45(@(t,x) odes(t,x, k1, k2, etc), tspan, x0)

カテゴリ

Help Center および File ExchangeOrdinary Differential Equations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by