Advertisement
slowmindead

ex2 lab2

Feb 28th, 2022
18
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. function xc=secanta(f,x0,x1,k)
  2. x(1)=x0;
  3. x(2)=x1;
  4. for i=2:k
  5. x(i+1)=x(i)-(f(x(i))*(x(i)-x(i-1)))/f(x(i))-f(x(i-1))
  6. end
  7. xc=x(k+1);
  8.  
  9.  
  10. %in matlab incepi de la 1 cu indexarea
  11. %x(i) e practic vectorul *x
  12.  
  13.  
  14.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement