help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Vectorizing a summation


From: Bård Skaflestad
Subject: Re: Vectorizing a summation
Date: Tue, 29 Jan 2013 16:21:54 +0100

On Tue, 2013-01-29 at 07:09 -0800, rdelgado wrote:
> Actual thing is that X, Y are vectors going i,j=1...MxN and P is a MxN x MxN
> matrix.
> The calculation is:
> 
> result = SUM(from i=1...MxN) SUM (from j=1...MxN) (Pi-Pj) * (Xi - Yi) * (Xj
> - Yj) 
> 
> As I posted before.

I am confused.  What does

        Pi - Pj

mean if P is an (MxN)-by-(MxN) matrix?

Would you mind writing out the actual loop, just using indices as you
would in traditional code, that you are trying to vectorise?


Sincerely,
-- 
Bård Skaflestad <address@hidden>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]