Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function xc = secant(f, x0, x1, k)
- x(1) = x0;
- x(2) = x1;
- for i=2:(k+1)
- x(i+1) = x(i) - f(x(i))*(x(i)-x(i-1))/(f(x(i)) - f(x(i-1)));
- end
- xc = x(k + 2);
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement