a guest Apr 23rd, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function c=newtdd(x,y,n)
  2. for j=1:n
  3.     v(j,1)=y(j); %fill in y column of newton trangle
  4. end
  5. for i=2:n
  6.     for j=1:n+1-i
  7.         v(j,i)=(v(j+1,i-1)-v(j,i-1))/(x(j+i-1)-x(j));
  8.     end
  9. end
  10. for i=1:n
  11.     c(i)=v(1,i);
  12. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand