here's an improvement to the above code:

I'm still unsure about it though... Can anyone tell me if it's ok?%set initial values for the parameter j%

i=1;

j=1;

for t = 0:.1:10; %set time interval t%

j = 1;

for x = -10:.1:10; %set line interval x%

p = 0:1:100; %define a summation prameter p%

A = 2.*cos(p*t).*cos(p*x).*exp(-p.^2); %define the sumamtions vector A%

s(i,j) = sum(A); %perform summation for fixed x and t and define the (i,j)-component of matrix s%

j=j+1; %increase j by 1%

end;

i=i+1; %increase i by 1%

end;

pcolor(s)