What is the fastest way to solve a large linear system in matlab? Is it faster than writing my own solver in C#?

4 views (last 30 days)
I encounter large linear systems of equations (>10000^2) in my work. Up to know I wrote my own solvers in C#, which did well with smaller systems. Can matlab handle large systems and if so, which is the best method? (Assume systems with unique non-zero solution).

Accepted Answer

John D'Errico
John D'Errico on 20 Jun 2016
Yes. MATLAB will generally be faster than home-grown code, and probably more stable too. Of course, it depends on what you know, and how good your skills are and your knowledge of linear algebra. So I cannot know what you have done on your own.
MATLAB will use tools like the BLAS, and linear algebra packages written by experts in the field. If you are not doing so, then your code might benefit from doing so.
The one thing you might consider is if you are using the sparse capabilities of MATLAB. If you have very large linear systems like that, the odds are extremely good that they are sparse. If they are truly sparse, then you will get a serious benefit from using the sparse capabilities. The difference can be immense there.

More Answers (0)

Categories

Find more on Linear Algebra in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!