Path: news.mathworks.com!not-for-mail
From: "Jerry" <mricad@yahoo.no000spppam.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Vectorization of matrix operations--need guru's help!
Date: Mon, 24 Nov 2008 22:34:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 12
Message-ID: <ggfa4q$1bl$1@fred.mathworks.com>
References: <ggeq17$hj$1@fred.mathworks.com> <ggeu2i$1l4$1@fred.mathworks.com> <ggf27m$5gd$1@fred.mathworks.com>
Reply-To: "Jerry" <mricad@yahoo.no000spppam.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1227566042 1397 172.30.248.37 (24 Nov 2008 22:34:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 24 Nov 2008 22:34:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 544673
Xref: news.mathworks.com comp.soft-sys.matlab:502968


"Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in message 
> 
>   Despite my intention to leave the implementation to you, curiosity got the better of me and I decided to see what the resulting code would look like.  Here it is.  See if you agree with it.
> 
>  m4 = (sum(sum(mwk,1))^2-sum(sum(mwk,1).^2)-sum(sum(mwk,2).^2) ...
>       +sum(sum(mwk.^2,1)))/(n0*n1*(n0-1)*(n1-1));
> 
> Roger Stafford

YES! And it's over 100 times faster! Thanks a million!
I was trying to implement your ideas but made a mistake in the last term.