Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: problem vectorizing
Date: Sat, 29 Nov 2008 01:59:02 +0000 (UTC)
Organization: Universit&#228;t Heidelberg
Lines: 18
Message-ID: <ggq7l6$91p$1@fred.mathworks.com>
References: <ggpuuf$scq$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1227923942 9273 172.30.248.35 (29 Nov 2008 01:59:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 29 Nov 2008 01:59:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 869888
Xref: news.mathworks.com comp.soft-sys.matlab:503731


Dear Zsolt!

> X = linspace(-a/2,a/2,length(Gpp));
> [X Y] = meshgrid(X);
> r = sqrt((X).^2+(Y).^2);
> tic
> ep = zeros(size(Egp));
> 
> for m=1:length(Gpp)
>     for n=1:length(Gpp)
>         ep = ep + Egp(m,n)*exp(i*Gpp(m,n).*r);
>     end
> end

Can you give us a definition of Gpp and Egp?
Is LENGTH(Gpp) save enough - I'd prefer SIZE(Gpp,1).

Kind regards, Jan