finding inverse of 3D matrix for speed

4 vues (au cours des 30 derniers jours)
RS
RS le 1 Juil 2015
Hi ..
In a 1D simulation, I have 'n' number of grid points and at each point, some data is stored in 3x3 matrix (A). For simplicity, lets say
tic;
n= 200000;
A = rand(3,3,n);
for i = 1:n
iA(:,:,i) = inv(A(:,:,i));
end
toc; Elapsed time is 0.536919 seconds.
With this the code is too slow because of the for loop. If there is any other efficient way anyone knows, pl suggest. The usual way of using "iA = inv(A)" fails as the matrix need to be 2D for using that command.
Thanks.

Réponses (1)

James Tursa
James Tursa le 1 Juil 2015
Modifié(e) : James Tursa le 1 Juil 2015

Catégories

En savoir plus sur Mathematics dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by