title: Error using dde23 (line 224) Derivative and history vectors have different lengths
body: <p>I am trying to solve a couple system of delay differential equations using <code>dde23</code>. While running the following code, I am getting an annoying error "Derivative and history vectors have different lengths" </p>
  
  <pre><code>function sol = prob1
      clf
     global Lembda alpha u1 u2  p q c d k a T  b zeta1 zeta2 A1 A2
     Lembda=2; b=0.07; d=0.0123; a=0.6; k=50; q=13; c=40; p=30; alpha = 0.4476; T=1; B=0.4; A1 =200; A2=100; zeta1=10; zeta2=30;
  lags = [ 10; 0.2; 2; 10; 0.2;  10; 0.2; 2; 10; 0.2;  15; 0.9; 0.17; 0.01; 0.5; 0.000010; 0.00002];
  
  sol = dde23(@prob2f,T,lags,[0,10], u1, u2);
  
  function yp = prob2f(t,y,Z,B)
  global Lembda alpha p b d c q T a k zeta1 zeta2 A1 A2
  x2 = y(1);
  y2 = y(2);
  z2 =  y(3);
  v = y(4);
  w =  y(5);
  xlag = Z(1,1);
  vlag = Z(2,1);
  
  %%%%%%%%%%%%%%%%
  x1 = y(6);
  y1 = y(7);
  z1 = y(8);
  v1 = y(9);
  w1 = y(10);
  
  x1lag = Z(1,1);
  v1lag = Z(2,1);
  %%%%%%%%%%%%%%%%%%%
  lambda1 = y(11);
  lambda2 = y(12);
  lambda3 = y(13);
  lambda4 = y(14);
  lambda5 = y(15);
  u1 =  y(16);
  u2=   y(17);
  lambda1lag = Z(1,1);
  lambda4lag = Z(2,1);
  %%%%%%%%%
  dxdt=Lembda-d*x2-B*x2*v;
  dydt=B*exp(-a*T)*xlag*vlag-a*y2 - alpha*y2*w;
  dzdt=alpha*y2*w - b*z2;
  dvdt=k*y2-p*v;
  dwdt=c*z2-q*w;
  %%%%%%%%% 
  dx1dt=Lembda-d*x1-(1-u1)*B*x1*v1;
  dy1dt=(1-u1)*B*exp(-a*T)*x1lag*v1lag-a*y1 - alpha*y1*w1;
  dz1dt=alpha*y1*w1 - b*z1;
  dv1dt=(1-u2)*k*y1-p*v1;
  dw1dt=c*z1-q*w1;
  %%%%%%%%%% 
  dlambda1dt= A1+lambda1*d+(1-u1)*lambda1*B*v1-(1-u1)*lambda2*B*v1lag*exp(-a*T)*lambda2*(T);
  dlambda2dt= a*lambda2+(lambda2-lambda3)*alpha*w1-lambda4*k*(u2-1);
  dlambda3dt= b*lambda3-c*lambda5;
  dlambda4dt= A2+(1-u1)*lambda1*B*x1+lambda4*p+lambda4*(T)*lambda2*x1lag*(u2-1)*exp(-a*T);
  dlambda5dt=alpha*lambda2*z1-alpha*lambda3*z1+lambda5*q;
       du1dt = ( lambda2*x1lag*v1lag - lambda1*x1*v1)*(B/zeta1); 
       du2dt =(lambda4*k*y2)/zeta2;
  yp = [ dxdt; dydt; dzdt; dvdt;dwdt; dx1dt; dy1dt; dz1dt; dv1dt;dw1dt; dlambda1dt; dlambda2dt; dlambda3dt ;dlambda4dt ;dlambda5dt; du1dt; du2dt ];
  </code></pre>
  
  <p>Can anyone guide me, to be able to resolve this issue?
  Thanks</p>