Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!x35g2000prf.googlegroups.com!not-for-mail
From:  bahoo <b83503104@yahoo.com>
Newsgroups: comp.soft-sys.matlab
Subject: how to do this without for loops?
Date: Thu, 09 Aug 2007 14:26:21 -0700
Organization: http://groups.google.com
Lines: 14
Message-ID: <1186694781.588924.201810@x35g2000prf.googlegroups.com>
NNTP-Posting-Host: 131.107.0.71
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
X-Trace: posting.google.com 1186694782 5014 127.0.0.1 (9 Aug 2007 21:26:22 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Thu, 9 Aug 2007 21:26:22 +0000 (UTC)
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6,gzip(gfe),gzip(gfe)
X-HTTP-Via: 1.1 RED-PRXY-21
Complaints-To: groups-abuse@google.com
Injection-Info: x35g2000prf.googlegroups.com; posting-host=131.107.0.71;
Xref: news.mathworks.com comp.soft-sys.matlab:423276


Hi,

I have two vectors, v1 and v2, with possibly different number of
elements.
I want to compute a matrix D without using for loops, that stores the
difference:

so that
D(i,j) = v1(i) - v2(j)

Can anyone show me how to do this without for loops?
Thanks!
bahoo