set(0,                           ...
   'defaultaxesfontsize', 20,   ...
   'defaultaxeslinewidth', 1.0, ...
   'defaultlinelinewidth', 1.2, ...
   'defaultpatchlinewidth', 0.7);

xlist = [1,2,3];

t = [0.01:.01:10];
d=1;  % the diffusion coefficient
for j = 1:3
    x = xlist(j);
    
f = exp(-x^2./(4*d*t))./sqrt(4*pi*d*t); % solution of the diffusion equation


figure(1)
plot(t,f,'linewidth',2)
xlabel('t','fontsize',20)
ylabel('u(x,t)','fontsize',20)
hold on

end
text(2, 0.19, 'x=1','fontsize',20)
text(2, 0.13, 'x=2','fontsize',20)
text(2, 0.058, 'x=3','fontsize',20)
hold off

sc = 0.1;
X = sqrt(max(-2*t.*log(sc^2* 4*t*pi),0));
figure(2)
plot(t,X,'linewidth',2)
xlabel('t','fontsize',20)
ylabel('X(t)','fontsize',20)