Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function NBD = newton_backward_differentiation(x, y)
- n = length(x);
- diff_table = zeros(n, n);
- for i = 1 : n
- diff_table(i, 1) = y(i);
- end
- for j = 2 : n
- for i = 1 : n - j + 1
- diff_table(i, j) = diff_table(i + 1, j - 1) - diff_table(i, j - 1);
- end
- end
- NBD = 0;
- for i = 2 : n
- NBD = NBD + diff_table(n - i + 1, i) / (i - 1);
- end
- NBD = NBD / (x(2) - x(1));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement