Asked by mohamed
on 26 Feb 2013

>> n=2; >>t=520 >> r=5; >> p=1000; >> x=n*r*t/p; a=1; , b=2; >> y=n*r*t/(p+a*n^2/x^2))+n*b; while abs(x-y)<= 0.001 x=y; y=n*r*t/((p+a*n^2/x^2))+n*b; end

*No products are associated with this question.*

Answer by Walter Roberson
on 26 Feb 2013

Accepted answer

I suspect you will find that your while loop body is not executing at all.

Show 4 older comments

Image Analyst
on 28 Feb 2013

*not less than* 0.001, **your loop never even gets entered the very first time**. If you learn how to use the debugger, or simply leave off semicolons, you will discover these kinds of things very very easily and quickly.

Related Content

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi test

Learn moreOpportunities for recent engineering grads.

Apply Today
## 0 Comments