I have a linear solve function:

ls = LinearSolve[MatrixForm[Transpose[basisNScoeffs]]];

Which I then use to generate a table of solutions:

solutions = ConstantArray[0, vBound];

For[ v = 1, v <= vBound, v++,
solutions[[v]] = ls[MatrixForm[v*kCoeffs]]];
The problem is that instead of solving the system and putting the solutions inside the table, Mathematica returns "LinearSolve functions", i.e. the output looks like:
solutions[[1]]=LinearSolve[ ...input I fed.........]
Does anyone know how to force Mathematica to "really" solve the system, so that all the computations would be made directly in the For loop?
Thanks in advance for any answer.
=================
=================
1 Answer
1
=================
MatrixForm is a formatting construct, and not a matrix that can be used by LinearSolve. If you remove it, and retain just the list of lists (that is, the matrix), you should no longer have any troubles.
As ab aside, you don't need a loop if you build the matrix whose columns are the right-hand side vectors you have (Transpose[{rhs1, rhs2, ...}]), then apply LinearSolve to that matrix. Use Transpose afterwards to have a list of vectors.
Thank you for your quick answer, this is exactly what I was looking for.
– Cédric Travelletti
May 25 at 8:59