フィルターのクリア

not enough input arguments help in line 6 please explain why.

1 回表示 (過去 30 日間)
Maureen
Maureen 2023 年 10 月 15 日
編集済み: Torsten 2023 年 10 月 15 日
ic = [2.5;0;0;0]; vspan = [0 10];
%[v,x] = ode45(@(v,x)ch6(t,x),vspan,ic);
[v,x] = ode45(@ch6,vspan,ic);
plot(v,x)
function xdot=ch6(v,x)
k = 0.0443;
Cto = 0.3045;
Fao = 2.5;
Ft = x(1)+x(2)+x(3); %%not enough input arguments
Ca = Cto*x(1)/Ft;
ra = -k*Ca;
rb = -ra;
rc = -2*ra;
xdot(1,:) = ra;
xdot(2,:) = rb;
xdot(3,:) = rc;
xdot(4,:) = 1-x(1)/Fao;
end

採用された回答

Torsten
Torsten 2023 年 10 月 15 日
移動済み: Torsten 2023 年 10 月 15 日
Works (see above).
The list of input arguments to your function in the call to ode45 was wrong.
[v,x] = ode45(@(v,x)ch6(t,x),vspan,ic);
makes no sense since t is undefined.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by