필터 지우기
필터 지우기

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 CenterFile Exchange에서 Programming에 대해 자세히 알아보기

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by