help-octave
[Top][All Lists]
Advanced

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

Re: Vectorizing a summation


From: Jordi Gutiérrez Hermoso
Subject: Re: Vectorizing a summation
Date: Tue, 29 Jan 2013 12:17:00 -0500

On 29 January 2013 10:56, Bård Skaflestad <address@hidden> wrote:
>         d = reshape(X - Y, [], 1);

Just want to say, I find

    d = (X-Y)(:)

more idiomatic.

Also, don't forget something like

    y = magic(5)(1,:)

    y - y'

i.e. using broadcasting for computing pairwise differences.

- Jordi G. H.


reply via email to

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