File Exchange

image thumbnail

Small size linear solver

version 1.1 (3.03 KB) by

Linear solver of multiple 2x2 and 3x3 systems



View License

Solve multiple (2x2) or (3x3) linear systems:

A(:,:,k)*X(:,:,k) = B(:,:,k) for k=1,2,...,N

The method used here is basic cofactor/determinant.

DISADVANTAGE: This method may be less accurate than Matlab backslash (using in for-loop) when the matrices are ill-conditioned.

ADVANTAGE: for a large number of systems - the speed-up is about 15-30 fold.

Comments and Ratings (3)

James Tursa

James Tursa (view profile)

FYI, I just uploaded a new version of MTIMESX that does small matrix multiplies (first two dimensions <= 4) with inline code in 'SPEED' mode. This runs faster than the previous version.

Yvan Lengwiler

Yvan Lengwiler (view profile)

Bruno. Please ignore my previous comment. I overlooked that another MathCentral submission is required for your program to run.

Yvan Lengwiler

Yvan Lengwiler (view profile)

Bruno, I tried to run your benchmark file (bench_inv2inv3.m) but ended up with an error:
??? Undefined function or method 'mtimesx' ...
A file seems to be missing.



Make sure calling MTIMESX with SPEED option
Modification of H1 lines

MATLAB Release
MATLAB 7.10 (R2010a)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video