daily pastebin goal
80%
SHARE
TWEET

Untitled

a guest Apr 17th, 2018 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data
Top