Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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:
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 arrayStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started