1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Matlab error message, help please

  1. Mar 16, 2013 #1
    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
     
  2. jcsd
  3. Mar 17, 2013 #2

    Simon Bridge

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member
    2016 Award

    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.
     
  4. Mar 17, 2013 #3
    I found the error. Turns out I missed a * when multiplying :-|
     
  5. Mar 17, 2013 #4

    Simon Bridge

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member
    2016 Award

    Well done.
    Amazing what you miss.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted



Similar Discussions: Matlab error message, help please
Loading...