n=-10:0.01:10; om=2*pi/10; mw=pi^1/4*exp(i*om*n).*exp(-(n.^2)/2); a=mw.*conj(mw); plot(n,a,n,real(mw),n,imag(mw)); legend('Modulus','Real','Imag');