DDE23 error "Derivative and history vectors have different lengths"

2 views (last 30 days)
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
%-------------------------------------------
has an error message of "Error using dde23 (line 223)
Derivative and history vectors have different lengths."

Answers (0)

Categories

Find more on Programming in Help Center and File Exchange

Tags

Products


Release

R2020a

Community Treasure Hunt

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

Start Hunting!