I want to create a $n \times n$ Vandermonde matrix
.
How could I set up a matrix, vMatrix
so I can just use
vMatrix[5]
and get an element of the matrix?
Do I have to set up a $n \times n$ null matrix first to build it?
xk[k_, n_] := (-1 + k*1/(n/2))
xk[4, 7]
f[x_] := 1/(1 + 25 x^2)
f[6]
fk[n_] := Table[f[xk[i, n]], {i, 0, n}]
fk[10]
PlotPoint[x_] :=
ListPlot[Table[{xk[i, x], Part[fk[x], i + 1]}, {i, 0, x}]]
PlotLine[x_] := Plot[f[i], {i, xk[0, x], xk[x, x]}]
Show[PlotLine[10], PlotPoint[10]]
getMatrix[N_] := Table[f[i]
```
DesignMatrix
for this. E.g.,DesignMatrix[Array[{x[#], 1} &, 5], y^Range[5], y]
. $\endgroup$