Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- E=0.005
- x1=0.5
- x2=10
- while(abs(x2-x1)>E)
- a=sign(myfun(x1))
- b=sign(myfun(x2))
- if a!=b
- x3=(x1+x2)/2
- c=sign(myfun(x3))
- else a=b
- disp("Podaj jeszcze raz liczby")
- end
- if a!=c
- x2=x3
- else
- x1=x3
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement