Path: news.mathworks.com!not-for-mail
From: "Marin Troselj" <mtroselj.einstein@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Vactorizating code / For loops
Date: Wed, 17 Dec 2008 22:01:07 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 15
Message-ID: <gibsr3$r3o$1@fred.mathworks.com>
Reply-To: "Marin Troselj" <mtroselj.einstein@gmail.com>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1229551267 27768 172.30.248.38 (17 Dec 2008 22:01:07 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 17 Dec 2008 22:01:07 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1644450
Xref: news.mathworks.com comp.soft-sys.matlab:507625

Hi there, I am new at using Matlab and I need some help!

Is there a way to vectorizate this code:
k=1;
for i=1:3841
for j=k:3841
distance(i,j)=strdist(strings{j,1}, string{j+1,1});
end
k=k+1;
end

I have putted different strings into cell array <strings> and i want to compute Levenshtein distance betwen every string in cell array <strings> getting as result matrix 3841x3841 with zeroes under main diagonal.

Thanks!
Marin