Question: lectures/notes that the forward difference quotient Dr[f; x, h]:= = f(x+h) - f(x) h converges linearly, and the central difference quotient Dc[f; x,h] =
![lectures/notes that the forward difference quotient Dr[f; x, h]:= = f(x+h) -](https://dsd5zvtm8ll6.cloudfront.net/questions/2024/03/65fc84df1d56c_1711051414526.jpg)
lectures/notes that the forward difference quotient Dr[f; x, h]:= = f(x+h) - f(x) h converges linearly, and the central difference quotient Dc[f; x,h] = f(xh) f(xh) - 2h 4 converges quadratically to f'(t) as h0 if f is smooth enough and no round-off errors occur. a) Write a function d=D_F(f,x,h) in Matlab that computes the forward difference quotient of f with step-size h at the point x. b) Write a function d-D_C(f,x,h) in Matlab that computes the central difference quotient of f with step-size h at the point x. c) Write a script diff_test in Matlab which uses the functions from tasks a) and b) to plot the errors ep(h)|sin'(1) Dr[sin; 1, h], ec(h) = | sin'(1) Dc[sin; 1, h]| = for h; 10/4, i = 0, 1,..., 50 into a loglog plot. Add a proper title, axis labels and a legend to your figure.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
