what's wrong my code about ode model
显示 更早的评论
I write this code
function dydt = celldynamics(t, y, params)
%% Unpack the input variables
C = y(1);
A = y(2);
I = y(3);
E = y(4);
S = y(5);
%% Unpack the parameter values
k = params(1);
r_C = params(2);
r_max = params(3);
r_A = params(4);
delta_A = params(5);
r_I = params(6);
delta_I = params(7);
r_E = params(8);
Eprime = params(9);
beta = params(10);
gamma = params(11);
r_S = params(12);
Sprime = params(13);
Cprime = params(14);
%% Compute f(C)
f_C = min(r_C * (1 - C / Cprime), r_max);
%% 5Compute the derivatives
dCdt = f_C * C - k * C * E;
dAdt = r_A * C - delta_A * A;
dIdt = r_I * C * E - delta_I * I;
dEdt = -r_E * (E - Eprime) + beta * A * I * E * S - gamma * E * S;
dSdt = -r_S * (S - Sprime) - beta * A * I * E * S + gamma * E * S;
%% Pack the output variables into dydt
dydt = [dCdt; dAdt; dIdt; dEdt; dSdt];
end
but this code doesn't work
about line 4 ' C=y(1)'
and then say ' Insufficient input arguments.'
So how to modify that?
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Programming 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!