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

3 replies · 2K views · last reply
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
 
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 :-|