Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Inverse Interpolation: We usually use interpolation to find a y value for a spec

ID: 3642817 • Letter: I

Question

Inverse Interpolation:
We usually use interpolation to find a y value for a specific x value. For example, given the stopping distances for a car going 30 mph and 40 mph, we can interpolate the stopping distance for a car going 35 mph. What if we are given the stopping distance of 93ft and we would like to know the speed of the car?

Inverse Interpolation will use the same interpolated values, but will set up an equation to solve for the missing value. For example, the linear interpolation for the stopping distances between two points will produce a linear equation (mx + b) where m and b vary depending on the points used. Inverse Interpolation will simply solve the equation mx + b = 93 ft to determine x.

We first need to find the equation by using polyfix command. We can then set up the solving process by using roots command.

Write MatLab code to employ inverse interpolation using linear interpolation polynomial to determine the value of x such that f(x) = 200 ft based on the following data of speed stopping distance:


Explanation / Answer

There is no in-built matlab command called polyfix, but I take it you meant polyfit. If we are given a vector x and a vector y with the relation y(i) = m*x(i) + b (where x and y have the same length).

Then to get m and b in the equation above we do

p = polyfit(x,y,1);

where p(1) = m and p(2) = b. So given a new point y0, we get the corresponding x0 by the equation y0 = mx0 + b => x0 = (y0 - b)/m, therefore:

x0 = (y0 - p(2))/p(1);

gives you the answer.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote