Question: Need the code of MATLAB. Implement the algorithm divdiff and newtval discussed in class. To use the algorithms, you'll have code similar to this: v

Need the code of MATLAB.
Implement the algorithm divdiff and newtval discussed in class. To use the algorithms, you'll have code similar to this: v = (x vector of data) c = (y vector of data) D = divdiff (X, Y); x = 0: 65; n = length(x); y = zeros (1,n); for k = 1:n y(k) = newtval(D,X, X(k)); end plot (X,Y,'o',x,y), axis ( [0 65 O 50]) Apply the algorithms to the following problem: Experiments are run to measure the fuel consumption of a car travelling at a constant speed. Let v be the speed in miles per hour, let m(v) be the mileage in miles per gallon, and c(v) be the fuel consumption in gallons per hour. The following table gives data on the fuel consumption of a 1993 Subaru Legacy when run at constant speed: v(mi/hr) c(v) (gal/hr) 5 10 .333 .4 15 20 25 30 .4688 .5882 .6757.75 50 55 60 1.471 1.447 1.667 65 1.912 Convert the fuel consumption c(v) to fuel mileage m(v). Build the interpolating polynomial using divdiff for the data set (v, m(v)) and use it to estimate the fuel mileage when the car travels at 40 mph
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
