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