Guest User

Untitled

a guest
Apr 17th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. function T = difference_table(Y)
  2. n = length(Y);
  3. %Construct empty forward difference table
  4. T = zeros(n, n);
  5. %Fill first column
  6. T(:,1) = Y;
  7. %Fill remaining columns
  8. for j = 2:n % j is the column index
  9. for i = j:n % i is the row index
  10. T(i,j) = T(i,j-1) - T(i-1,j-1);
  11. end
  12. end
Add Comment
Please, Sign In to add comment