Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Double sum question
Date: Thu, 17 Jun 2010 17:34:22 +0000 (UTC)
Organization: Xoran Technologies
Lines: 29
Message-ID: <hvdmau$l2c$1@fred.mathworks.com>
References: <34f86e08-19ab-49a9-a3c0-e908bd93de65@j12g2000pri.googlegroups.com> <b14ebba5-2866-4fd8-b341-f83178c5091b@n37g2000prc.googlegroups.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1276796062 21580 172.30.248.38 (17 Jun 2010 17:34:22 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 17 Jun 2010 17:34:22 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1440443
Xref: news.mathworks.com comp.soft-sys.matlab:645855

Marios Karaoulis <marios.karaoulis@gmail.com> wrote in message <b14ebba5-2866-4fd8-b341-f83178c5091b@n37g2000prc.googlegroups.com>...
> I have another double sum, (if you don't mind)
> 
> s1=a(i,a1)+a(i,a2)+a(i,a3);
> s2=a(j,a1)+a(j,a2)+a(j,a3);
> sum1=2*(a(i,a1)*a(j,a1)+a(i,a2)*a(j,a2)+a(i,a3)*a(j,a3))+s1*s2;
> 
> I tried creating this matrix
> um=[2 1 1;
>     1 2 1;
>     1 1 2];
> 
> 
> and then
> 
> jam4=sum(prod(A*um,1));
=================

It's inadvisable to try random things without knowing if/why they might work.




 
> P.S., it would be great if I could combine the previous two sums, in
> just one equation!!!
===========

sum1=A(1,:)*um*A(2,:).'