Question: Write two functions in Matlab. The first function, called divdiff, should read in two vectors x and y, and return a table (a matrix) of

Write two functions in Matlab. The first function, called divdiff, should read in two vectors x and y, and return a table (a matrix) of the divided difference values. This means, the first few lines of your divdiff.m file should be: function a = divdiff (x, y) % input: x, y: the data set to be interpolated %output: a: table for Newton's divided differences. The second function called polyvalue, should read in the table of divided difference values generated by the function divdiff, the x-vector, and a vector t. The output of the function are the values of Newton's polynomial computed at points given in the vector t. This means, your file polyvalue. m should start with the following few lines: function v = poly value (a, x, t) %input: a = Newton's divided differences % x = the points for the data set to interpolate, % same as in divdiff. % t = the points where the polynomial should be evaluated % output: v = value of polynomial at the points in t what to hand in: Hand in the files divdiff.m and polyvalue.m Write two functions in Matlab. The first function, called divdiff, should read in two vectors x and y, and return a table (a matrix) of the divided difference values. This means, the first few lines of your divdiff.m file should be: function a = divdiff (x, y) % input: x, y: the data set to be interpolated %output: a: table for Newton's divided differences. The second function called polyvalue, should read in the table of divided difference values generated by the function divdiff, the x-vector, and a vector t. The output of the function are the values of Newton's polynomial computed at points given in the vector t. This means, your file polyvalue. m should start with the following few lines: function v = poly value (a, x, t) %input: a = Newton's divided differences % x = the points for the data set to interpolate, % same as in divdiff. % t = the points where the polynomial should be evaluated % output: v = value of polynomial at the points in t what to hand in: Hand in the files divdiff.m and polyvalue.m
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
