-1

Consider the matlab function that describe in the image.

enter image description here

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!

MrSonic
  • 363
  • 3
  • 10

1 Answers1

2

Because the while gets false from the first iteration and stop.

use while (a>=v(j)) to resolve your issue.

Mohammad nagdawi
  • 553
  • 4
  • 18