Effacer les filtres
Effacer les filtres

Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

Taking a tiny part of a huge matrix still matters to calculaltion time ?

2 vues (au cours des 30 derniers jours)
Jeon
Jeon le 12 Août 2013
Clôturé : MATLAB Answer Bot le 20 Août 2021
Say I have a matrix 'A' sized 10000 x 1000
But I just use A(1:10, 1:10) for a certain purpose.
Of course, it takes shorter time than A(:, :)
But, is it slower significatly than when use matrix B sized 10 x 10 ?
size(A)
ans = 10000 10000
tic
some_calculation( A(1:10, 1:10) );
toc
size(B)
ans = 10 10
tic
some_calculation( B(1:10, 1:10) );
toc

Réponses (1)

per isakson
per isakson le 12 Août 2013
Because the sub-matrix is not in a contiguous piece of memory.

Cette question est clôturée.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by