0

Like the title says i want to transform a Matrix into a list so i can use LinearSolve what's the way to do it?

xk[k_, n_] := (-1 + (k)*(2/(n)))
xk[1, 2]
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[xk[i - 1, N - 1]^(j - 1), {i, N}, {j, N}] // MatrixForm

getMatrix[3]
LinearSolve[List[getMatrix[4]], Table[xk[k, 3], {k, 0, 3}]]

Tried List

J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574
Rapiz
  • 75
  • 5
  • Doesn't work. I want to use my matrix in LinearSolve. – Rapiz Dec 02 '19 at 15:05
  • 2
    It's not clear what you mean by "transform to a list". Can you edit the question and clarify? A clearly written minimal example would help. – Szabolcs Dec 02 '19 at 15:09
  • 3
    You can't useMatrixForm in definitions of you matrix quantities. Delete //MatrixForm from the definition of getMatrix. Then, delete List from your LinearSolve. – K.J. Dec 02 '19 at 15:51
  • 1
    @Rapiz You were already told yesterday that MatrixForm is a formatting-only function, and not to use it in definitions. That was good advice... – MarcoB Dec 02 '19 at 22:34

0 Answers0