Question: Solve this using MATLAB 2. (20 points) Consider approximating derivatives of f(x) on la, o with finite difference formulas. First, divide the function domain la,
2. (20 points) Consider approximating derivatives of f(x) on la, o with finite difference formulas. First, divide the function domain la, b] into n equi-distant sub-intervals: where x's are called nodes. Define the grid size h as h = (b-a)-zi-Z-1. Next, denote the column vector as function valueWrite a MATLAB function that approximates f'(x) at (xi-o with second-order accuracy . fp fd.fp(a,b,f) f is the column vector of function values. . fp is the column vector of the approximations to the first derivative. Use the three-point centered-difference formula for the interior points. Use FDF2 and BDF2 formulas for the two end points
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
