Subscript indices must either be real positive integers or logicals in doubleODE

  • Thread starter Thread starter Daniel1992
  • Start date Start date
  • Tags Tags
    Error Matlab
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
3 replies · 2K views
Daniel1992
Messages
21
Reaction score
0
I get this error message

Subscript indices must either be real positive integers or logicals.

Error in doubleODE (line 14)
dYdt(2) = l1*(m1 + m2)*Y(4) - l2*m2*Y(3)*cos(Y(1) - Y(2))/...

I am having trouble working out what is causing the problem. Any advice?

Thanks
 
Physics news on Phys.org
It means that you have indices which are not positive integers or logicals so that it chokes on line 14
The actual fault will be before then - without the source code we cannot possibly help.
 
I found the error. Turns out I missed a * when multiplying :-|