help-octave
[Top][All Lists]
Advanced

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

Summation and Mesh Plot


From: Anan
Subject: Summation and Mesh Plot
Date: Thu, 29 Jul 2010 05:08:51 -0700 (PDT)

I am trying to get the mesh plot which involve a summation.
the code is 

x=[-4:0.1:4];
y=x;
[xx,yy]=meshgrid(x,y);
fac1=0.0+0.0j;
fac2=0.0+0.0j;
for a=1:10
for c=1:10
     fac2=fac2+exp(j*(c-a).*xx);
endfor
endfor
for b=1:10
for a=1:10
     fac1=fac1+exp(j*(a-b).*yy)
endfor
endfor
mesh(xx,yy,abs(fac1.*fac2).^2);

Is it the correct method to calculate the summation while keeping (x,y) as a
meshgrid.

-- 
View this message in context: 
http://octave.1599824.n4.nabble.com/Summation-and-Mesh-Plot-tp2306377p2306377.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

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