MATLAB: Ax = b for a lot of different b‘s

ax = biterative solverMATLABParallel Computing Toolboxsystem of equations

Hello,
I have a system of equation Ax = b, where A is very large (n = 3e5 – 8e5) and sparse coefficient matrix, b is source term and x is the solution. Of course it's not a problem to solve such a problem in MATLAB, however I have to solve Ax = b for a lot of different b‘s without any change in the coefficient matrix A. The inversion of the matrix A take so long, that it is faster to solve the problem for each new b vector separately using an iterative solver. Unfortunately it is still way too slow, so I'm looking for a way how to speed it up.
Does anybody know, how to improve the performance?
Thank you for help!

Best Answer

Neither direct inversion of A, nor iterative methods are required. Just create a matrix B whose columns are the different b. Then do
X=A\B
Each column X(:,i) will be the solution for the corresponding b.