title: Error while solving differential equations matlab
body: <p>I'm looking for way to solve this differential equations. </p>
  
  <p><img src="https://i.stack.imgur.com/TVpfw.png" alt="equations"></p>
  
  <p>I've got small experience solving this type of equations, so here's my noob code</p>
  
  <pre><code>function lab1()
  [t,h]=ode45('threepoint', [0 1000], [0 0.25]);
  plot(t, h);  
  
  function f = threepoint(x, y)
  %THREEPOINT Summary of this function goes here
  %   Detailed explanation goes here
  m = 15000;
  R1 = 0.1;
  R2 = 0.1;
  P1 = 0.1;
  P2 = 0.1;
  B = 4;
  rbk = 0.5;
  f=[x(6);
      x(7);
      x(8);
      x(9);
      x(10);
      (-x(6) / (m * sqrt( x(6)*x(6) + x(7)*x(7)))) * (R1 + R2) + (cos(x(3))/m) * P1 + (cos(x(3))/m) * P2;
      (-x(7) / (m * sqrt( x(6)*x(6) + x(7)*x(7)))) * (R1 + R2) + (cos(x(3))/m) * P1 + (cos(x(3))/m) * P2;
      -(M/I) - (1/I1)* (B/2 + y(1))*P1 + (1/I2)*(B/2+y(2))*P2;
      (rbk/I1)*(P1-R1);
      (rbk/I2)*(P2-R2);
      ];  
  end
  </code></pre>
  
  <p>While running these functions I have got such errors like </p>
  
  <blockquote>
    <p>Index exceeds matrix dimensions.</p>
    
    <p>Error in threepoint (line 11) f=[x(6);</p>
    
    <p>Error in odearguments (line 87) f0 = feval(ode,t0,y0,args{:});   %
    ODE15I sets args{1} to yp0.</p>
    
    <p>Error in ode45 (line 113) [neq, tspan, ntspan, next, t0, tfinal, tdir,
    y0, f0, odeArgs, odeFcn, ...</p>
    
    <p>Error in lab1 (line 2) [t,h]=ode45('threepoint', [0 1000], [0 0.25]);</p>
  </blockquote>
  
  <p>Can anyone please show me where am I mistaken and how can I fix these errors?
  Thank you in advance!</p>