usefulcodes.blogspot.com
Pages
(Move to ...)
Home
About ME
▼
Sunday, September 27, 2009
faster way to sum desired matrix elements in matlab
Just works
g = rand(5)
p = blkdiag(1,1,0,1,1)
index = find(p~=0)
sum(g(index))
No comments:
Post a Comment
‹
›
Home
View web version
No comments:
Post a Comment