|
From: | James Sherman Jr. |
Subject: | Re: Matrix loop |
Date: | Wed, 5 May 2010 14:23:12 -0400 |
Hi,
I would know if is there a more efficient way to perform the following operation
s_cR =21;
n=1000;
a= rand(s_cR,s_cR,n);
whos a
meant = mean(a,3);
whos meant
for tt=1:n
b(:,:,tt) = a(:,:,tt) - meant;
c(:,:,tt)= b(:,:,tt) * b(:,:,tt)';
endfor
result = sum(c,3)*1/n;
whos result
Thanks in advance
_______________________________________________
Help-octave mailing list
address@hidden
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
[Prev in Thread] | Current Thread | [Next in Thread] |