Here is some software guidance on HW2, written by Brian Hunt.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
As seen in class, floating-point software like MATLAB is not able to
compute high-degree interpolating polynomials. Symbolic programs like
Mathematica can do arithmetic at much higher precision. To read data
into Mathematica, use Import, e.g.:
data = Import["Births1978.txt", "Table"];
y = data[[Range[365], 2]];
The latter command selects the 2nd column of the table. The data file
must be in Mathematica's current working directory; otherwise, use the
(absolute or relative) path name of the data file. See the
documentation for InterpolatingPolynomial for instructions on how to
generate and evaluate a Lagrange polynomial from the data. Other
useful command may be Range (to generate a list of x values), ListPlot
(to graph the data), and Plot (to graph the interpolating polynomial,
if you dare).
Alternatives to Mathematica include Maple and MuPAD. MuPAD is
included with newer versions of the symbolic toolbox in MATLAB.
Unfortunately, moving data between MATLAB and MuPAD is not simple.
The following MATLAB commands open a MuPAD window and define a vector
y in MuPAD from an already-defined vector y in MATLAB.
nb = mupad
setVar(nb, 'y', sym(y))
The MuPAD command for a Lagrange polynomial is "interpolate" (or
perhaps "lagrange" in older versions). To use the vector of values
defined above in "interpolate", you need to reformat it, e.g.:
newy := [y[k] $ k = 1..365]