Is there a good reason why you initialized dx to be zero?
Do you see that immediately after that, you start a while loop. What is the codition?
Now, ask yourself. What was dx again when the loop started?
What is the value of Tol?
Is this true? (dx > Tol)?
Do you expect the while loop to ever allow entrance into the code inside that loop? What would happen if you wrote this code fragment?
disp('The sky is falling! (sincerely, Chicken Little)')
How many times would you expect to see anything written to the command window?
Best Answer