Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: looping issue
Date: Tue, 28 Sep 2010 09:27:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 14
Message-ID: <i7scd6$fd3$1@fred.mathworks.com>
References: <i7rsj0$1ln$1@fred.mathworks.com> <i7rv9r$rvf$1@fred.mathworks.com> <i7s01p$gab$1@fred.mathworks.com> <i7s168$e0$1@fred.mathworks.com> <i7s70r$kgf$1@fred.mathworks.com> <i7sbdd$b0o$1@fred.mathworks.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 1285666022 15779 172.30.248.38 (28 Sep 2010 09:27:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 28 Sep 2010 09:27:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: news.mathworks.com comp.soft-sys.matlab:673817

"Kate " <chino_tones@hotmail.com> wrote in message <i7sbdd$b0o$1@fred.mathworks.com>...
> appreciate it roger.
> 
> thank you
> kate
- - - - - - - -
  Here is a slightly more compact method:

 n = size(Lines,1);
 V = Lines(:,3:4)-Lines(:,1:2); % n rows of 2-element vectors in x-y plane
 M = V*V.'; % Compute all pairs of dot products
 M(1:n+1:n^2) = []; % Remove the diagonal

Roger Stafford