Taking a tiny part of a huge matrix still matters to calculaltion time ?
情報
この質問は閉じられています。 編集または回答するには再度開いてください。
古いコメントを表示
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
0 件のコメント
回答 (1 件)
per isakson
2013 年 8 月 12 日
0 投票
Because the sub-matrix is not in a contiguous piece of memory.
0 件のコメント
この質問は閉じられています。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!