View License

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

» Watch video

Highlights from
Small size linear solver

Be the first to rate this file! 4 Downloads (last 30 days) File Size: 3.03 KB File ID: #27762 Version: 1.1

Small size linear solver


Bruno Luong (view profile)


27 May 2010 (Updated )

Linear solver of multiple 2x2 and 3x3 systems

| Watch this File

File Information

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.


Mtimesx Fast Matrix Multiply With Multi Dimensional Support inspired this file.

MATLAB release MATLAB 7.10 (R2010a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (3)
10 Aug 2010 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.

Comment only
29 May 2010 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.

Comment only
29 May 2010 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.

Comment only
28 May 2010 1.1

Make sure calling MTIMESX with SPEED option
Modification of H1 lines

Contact us