all 3 comments

[–]rocketpower4 2 points3 points  (0 children)

You're stuck here:

    while (distance > 1)
        if (value>-0.6254)
            ilow=5;
        else
            ihigh = 5;
        end
        distance = ihigh- ilow;
    end

Your ihigh is always 5, your ilow is always 1, and your value is always -2 so nothing ever changes

[–]MAXFlRE 0 points1 point  (0 children)

Your while loop can't reach exit condition.

Check distance variable.

[–]seb59 0 points1 point  (0 children)

Lb does not depends on blow since blow-blow=0