. Finite difference formulas. Write a Matlab function thatconstructs finite difference formulas for a given stencil andderivative order. That is, given points x0, x1, . . . , xn and apositive integer d, your code should compute c0, c1, . . . , cnsuch that
f (d) (x) ≈ Xn i=0 cif(x + xi).
The function signature should be
function C = fdcoeff(X, d)
where X is a numeric array containing the (distinct) stencilpoints, d is the desired derivative order, and C is an array ofstencil coefficients. For example, fdcoeff([-1, 0, 1], 1) shouldreturn [-0.5, 0, 0.5] (the 3-point midpoint formula). Note that thetextbook
PayPal Gateway not configured
PayPal Gateway not configured