summation
4 ビュー (過去 30 日間)
古いコメントを表示
how to implement summation in matlab Is there any function for 2D summation in matlab
0 件のコメント
回答 (2 件)
TAB
2011 年 9 月 28 日
A=rand(5);
As=sum(sum(A));
3 件のコメント
Andrei Bobrov
2011 年 9 月 28 日
Hi Jan!
A= rand(5000);
tic,sum(sum(A));toc
tic,sum(A(:));toc
clear A
Elapsed time is 0.037663 seconds.
Elapsed time is 0.037902 seconds.
MATLAB R2010a, Intel Core2 Duo, 2.13 GHz, 2 GB RAM
TAB
2011 年 9 月 28 日
On Matlab R2007a , C2D, 4GB RAM
A= rand(5000);
tic,sum(sum(A));toc --> 0.047444 Sec
tic,sum(A(:));toc --> 0.047441 Sec
Yes, Andrei's version is faster. :-)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!