Consider the matlab function that describe in the image.
As I run this function, I get that y = 1 insted of y = 7 as expected.
Why is this happening?
any response will be appreciated.
Thanks!
Consider the matlab function that describe in the image.
As I run this function, I get that y = 1 insted of y = 7 as expected.
Why is this happening?
any response will be appreciated.
Thanks!
Because the while
gets false
from the first iteration and stop.
use while (a>=v(j))
to resolve your issue.