Develop an M-file function that computes first and

can you slove this question using matlab software onlythanks

Develop an M-file function that computes first and second derivative estimates of order O(h^2) based on the formulas in Figs. 21.3 through 21.5. The function’s first line should be set up as function [dydx, d2ydx2] = diffeq(x,y) where x and y are input vectors of length n containing the values of the independent and dependent variables, respectively, and dydx and dy2dx2 are output vectors of length n containing the first- and second-derivative estimates at each value of the independent variable. The function should generate a plot of dydx and dy2dx2 versus x. Have your M-file return an error message if (a) the input vectors are not the same length, or (b) the values for the independent variable are not equally spaced. Test your program with the data from Prob. 21.11.Show transcribed image text