There are a number of errors there. Not exactly sure what you want, but is this closer?
% attempt
sigma=12
alpha=0.01
exact = @(t,x) exp(-(x-0.4).^2 ./(2*alpha * t + 1/sigma)) ./ sqrt(sigma*alpha.*t+3);
Nt=200;
dt=1/Nt;
Nx=200;
dx=1/Nx;
t1=linspace(0,1,Nt)
x1=linspace(0,1,Nx)
[t2, x2] = meshgrid(t1, x1);
output = exact(t2,x2)
imshow(output, []);
colormap(jet(256));
colorbar;