Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function x = bisekcja(f, xp, xk, N)
- a = f(xp)
- b = f(xk)
- if (a*b > 0.0)
- disp("f(x) ma taki sam znak na obydwu końcach badanego przedziału")
- end
- for k=1:N
- x = (xp + xk)/2
- y = f(x)
- if (a*y < 0)
- xk = x
- else
- xp = x
- end
- end
- endfunction
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement