Path: news.mathworks.com!not-for-mail
From: "Bruno Luong" <b.luong@fogale.findmycountry>
Newsgroups: comp.soft-sys.matlab
Subject: Re: avoiding loops to built a z matrix of the most efficient form
Date: Wed, 25 Mar 2009 21:02:02 +0000 (UTC)
Organization: FOGALE nanotech
Lines: 7
Message-ID: <gqe649$26e$1@fred.mathworks.com>
References: <gqdj93$qa4$1@fred.mathworks.com> <gqdn0i$a5r$1@fred.mathworks.com> <gqdr01$jp4$1@fred.mathworks.com> <gqduat$hug$1@fred.mathworks.com> <gqdvgd$bvg$1@fred.mathworks.com> <gqe1nl$cra$1@fred.mathworks.com> <gqe4fp$1ml$1@fred.mathworks.com>
Reply-To: "Bruno Luong" <b.luong@fogale.findmycountry>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1238014922 2254 172.30.248.38 (25 Mar 2009 21:02:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 25 Mar 2009 21:02:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: news.mathworks.com comp.soft-sys.matlab:527751

And what about this?

bfun=@(x) sum((x*inversa).*x,2);
z=(sum(bfun(v1))+nrp*bfun(v2) - ...
    (v2*((inversa+inversa.')*sum(v1,1).'))).';

Bruno