Skip to content
Prev 78574 / 398502 Next

Applying a function to each element of an array

Well, since Sum(i=1 to i-n) =n*(n+1)/2, your loop simply gives
1/4*count*(count-1).
So if your matrix is A, A*(A-1)/4 is about the quickest way to get your
answer I think.

-- Bert Gunter
Genentech Non-Clinical Statistics
South San Francisco, CA
 
"The business of the statistician is to catalyze the scientific learning
process."  - George E. P. Box