{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

extrapolate - %correspond to the given new x values...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
function newy = extrapolate(vecx,vecy,newx) %Given a vector of x values, a vector of corresponding y values and a %vector of new x values, write a function extrapolate that will fit a %polynomial through all the points described by the inputted x and y %values. extrapolate should use the highest degree that produces a %unique fit. extrapolate should return a vector of new y values which
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: %correspond to the given new x values evaluated at the computed %polynomial. order = length(vecx) - 1; %finds the order of the polynomial coeff = polyfit(vecx,vecy,order); %determines the coefficients of the best fit line newy = polyval(coeff,newx); %determines the new y values of the best fit line end...
View Full Document

{[ snackBarMessage ]}