Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function [wyn] = met_siecznychv2(g,x1,x2)
- f = @(x)eval(g);
- ep = 0.001;
- if(f(x1)*f(x2)>0)
- disp('Punkty nie spelniaja zalozen')
- return;
- end
- while(abs(f(x2))>ep)
- x0 = x1 - f(x1)*(x1-x2)/(f(x1)-f(x2));
- x2 = x1;
- x1 = x0;
- end
- wyn = x0;
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement