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.
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.
Bruno. Please ignore my previous comment. I overlooked that another MathCentral submission is required for your program to run.
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
Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.