DDE23 error "Derivative and history vectors have different lengths"
2 views (last 30 days)
Show older comments
lags = 1;
tspan = [0 10];
sol = dde23(@ddefun, lags, @history, tspan);
function dydt = ddefun(t,y,Z) % equation being solved
ylag1 = Z(:,1);
global b1 N v d
dydt = [-(b1/N)*y(1)*y(2);
(b1/N)*y(1)*y(2)-(v+d)*ylag1(2);
v*ylag1(2);
d*ylag1(2)];
end
%-------------------------------------------
function s = history(t) % history function for t <= 0
s = ones(4,1);
end
%-------------------------------------------
Derivative and history vectors have different lengths."
2 Comments
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!