Memming's Inconsistency
Nothing Personal, Yet Subjective
Blog | Guestbook
Keyword | Local | Tag
T 27 / Y 78 / Total 54293
Catergories
Calendar
«   2010/07   »
Sun Mon Tue Wed Thu Fri Sat
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Tag
tip, MATLAB, vim, LaTeX, mathematics, Google, Tips, 촛불집회, derivative, conference wsom, theorem, CNEL, correlogram, ocw, equation search engine, algorithm, synchrony, spike train, coupled oscillator, javascript,
Archive
Link
Search
  submit
Recent Articles
Recent Comments
Recent Trackbacks
2009/09/16 08:12
sum(sum(K)) vs o * K * o'
2009/09/16 08:12 2009/09/16 08:12
Simple speed comparison on MATLAB 7.0.4.356
K = randn(100,100);
>> o = ones(1,size(K,1)); tic; for k = 1:10000; o * K * o'; end; toc
Elapsed time is 0.156108 seconds.
>> tic; for k = 1:10000; sum(sum(K)); end; toc
Elapsed time is 0.937100 seconds.
TAG : ,
Trackback : http://blog.memming.com/trackback/2304417
Memming (2010/01/21 15:32)
I should have compared against sum(K(:)) as well.....Hmmmm

Memming (2010/01/22 17:23)
>> o = ones(1,size(K,1)); tic; for k = 1:10000; o * K * o'; end; toc
Elapsed time is 0.151128 seconds.
>> tic; for k = 1:10000; sum(sum(K)); end; toc
Elapsed time is 0.257047 seconds.
>> tic; for k = 1:10000; sum(K(:)); end; toc
Elapsed time is 0.224368 seconds.

Name   Password   Home   Secret   Submit
 Prev   1   2   3   4   5   6  ...  29   Next 
memming’s Blog is powered by Tattertools.com / Designed by faido