Question: This is in MATLAB code Write a function with header [df, X] = myDerCalc(f, a, b, N, option) where f is a function handle, a
This is in MATLAB code
Write a function with header [df, X] = myDerCalc(f, a, b, N, option) where f is a function handle, a and b are scalars such that a < b, N is an integer bigger than 10, and option is the string'forward', 'backward', or 'central'. Let x be an array starting at a, ending at b, containing N evenly spaced elements, and let y be the array f(x). The output argument, df, should be the numerical derivatives computed for x and y according to the method defined by the input argument, option. The output argument X should be an array the same size as df containing the points in x for which df is valid. Specifically, the forward difference method loses the last point, the backward difference method loses the first point, and the central difference method loses the first and last point.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
