Question: Can someone help me solve the following problem using Matlab Language ? Here are some hints and tips. Problem 1: Numerical Differentiation % Basic idea:

Can someone help me solve the following problem using Matlab Language? Here are some hints and tips.

Problem 1: Numerical Differentiation % Basic idea: Take a point to the right and a point to the left and average % their slopes. % One-sided estimates: Leftmost point and rightmost point. % Equation (2) is for the rightmost edge. % Equation (3) is for the leftmost edge. % These are "higher order" methods as they are more accurate than linear, quadratic, trapezoidal, simpson's % Error if you have  

Can someone help me solve the following problem using Matlab Language? Hereare some hints and tips. Problem 1: Numerical Differentiation % Basic idea:

Homework Problem 1: Numerical Differentiation In this problem, you will compute numerical derivatives of functions using "higher-order" techniques as compared to what we saw in lecture. For points in x separated by a distance of h, a centered estimate for the first derivative is given by: r +h)- f(x -h 2h One-sided estimates can be computed by 2h h) - f(x 2h 2h Note that you need two points to compute a centered derivative and three points to compute a one-sided derivative Create a function MyDer which takes as inputs h (the x-spacing) and y (an array of data) and returns the first order derivative yp of y using Equation (1), Equation (2) and Equation (3). Your code must return an error if you have less than three data points as you cannot evaluate a one-sided derivative otherwise. You can use the following test case to check your code

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!