Please write this function on MATLAB numerical analysis.
The Algorithm of Newton's Divided-Difference: To obtain the divided-difference coefficients of the interpolating polynomial P(x) on the n + 1 distinct numbers X0, X1, Xn for the function f(x):
Input: numbers X0, X1, Xn; values f(x0), f(x1), f(xn)
Output: the numbers F0,0, F1,1, Fn,n where P(x) = F0,0 * (x - x0)
Step 1: For i = 0, 1, 2, ..., n, set Fi,0 = f(xi)
Step 2: For i = 1, 2, ..., n
For j = 1, 2, ..., i
Set Fi,j = (Fi,j-1 - Fi-1,j-1) / (xi - xi-j)
Output (F0,0, F1,1, Fn,n) (where Fi = f(xi) * (x - xi))