summation
13 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
how to implement summation in matlab Is there any function for 2D summation in matlab
0 commentaires
Réponses (2)
TAB
le 28 Sep 2011
A=rand(5);
As=sum(sum(A));
3 commentaires
Andrei Bobrov
le 28 Sep 2011
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
le 28 Sep 2011
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. :-)
Voir également
Catégories
En savoir plus sur Language Fundamentals 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!