Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function [x] = regula_falsi_method(a, b, max_iter, max_error, my_function)
- for i = 1:max_iter
- x = b - feval(my_function, b) * ((b-a)/(feval(my_function, b)-feval(my_function, a)));
- if abs(feval(my_function, x)) < max_error
- return;
- end
- if (feval(my_function, b) * feval(my_function, x) < 0)
- a = x;
- else
- b = x;
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement