Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: for loop ode45 with dynamic variables
Replies: 1   Last Post: Dec 5, 2012 7:07 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Nasser Abbasi

Posts: 5,674
Registered: 2/7/05
Re: for loop ode45 with dynamic variables
Posted: Dec 5, 2012 7:07 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 12/4/2012 8:13 PM, Kitech wrote:

>I have looked over the code many many times but I am not sure where the fault is as
>the solution comes up as "NaN." I have not shown constants in the code:
>


Ok, so debugging is hard. But no one said programming is easy. So
you should first do as you have done, which is code inspection,
no computers. Make a nice clean print out of the code, have
a red pen in you hand, put the listing in front of you,
and read the code and make sure it is correct. Think about
the logic, see if it all flows as expected, etc...

When this does not help, the next step is to use the debugger.

Make break points, step into the code, until you see the problem show up.

It is hard work, but this is programming. debugging is part of
programming, asking someone else to debug your code for you will
not help you learn how to do it.

--Nasser





Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.