Question: Create a MATLAB function: There are many other ways of approximating the derivative using finite differences. For points in x equidistant by h, a centered

Create a MATLAB function: Create a MATLAB function: There are many other ways of approximating

There are many other ways of approximating the derivative using finite differences. For points in x equidistant by h, a centered estimate for the first derivative of f(x) is f(x + h) - f(x - h) 21 One-sided estimates can be computed by I f'(x) = 3f(z) 4f (x - h) + f(x 21) 2h -3f(x) + 4f (x + h) - f(x + 2h) f'(z) = - 2h (9) Note that 2 points are need to compute a centered estimate and 3 points are need for one-sided estimates. 1. Write a function yp = MyDer (h,y) that takes in the x-spacing h, an array of data y and returns the first-order derivative yp of y using (7), (8) and (9) in order to maintain the original size of the array. There are many other ways of approximating the derivative using finite differences. For points in x equidistant by h, a centered estimate for the first derivative of f(x) is f(x + h) - f(x - h) 21 One-sided estimates can be computed by I f'(x) = 3f(z) 4f (x - h) + f(x 21) 2h -3f(x) + 4f (x + h) - f(x + 2h) f'(z) = - 2h (9) Note that 2 points are need to compute a centered estimate and 3 points are need for one-sided estimates. 1. Write a function yp = MyDer (h,y) that takes in the x-spacing h, an array of data y and returns the first-order derivative yp of y using (7), (8) and (9) in order to maintain the original size of the array

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!