Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- liczba_iteracji=15;
- epsilon_1=e^-6;
- epsilon_2=e^-6;
- x0=0;
- f=@(x)x^3-2*x^2-11*x+12;
- i=0;
- while i<liczba_iteracji
- i=i+1;
- x=x0-(f(x0)/diff(f(x0)));
- if(abs(f(x))<epsilon_1)
- break;
- end;
- if(abs(x-x0)<epsilon_2)
- break;
- end;
- x0=x;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement