Comparing the FFT to numerical integration in Matlab The result of calculating the fourier transform using numerical integration is:

the result of using Matlab's FFT is:

So where did I go wrong here? I know the FT of a Gaussian should be another Gaussian.  Shouldn't they be the same? Furthermore I would have thought the
Edit:
Following a suggestion using the fftshift function gets me to the following plot, but this looks very different to the original fft despite documentation stating that it just centres the result around zero frequency.

which is more resembling what I would expect.
omega = linspace(-30,30,1000);

t = linspace(-10,10,1000);
y = exp(-t.^2./2)/sqrt(2*pi);
Yft = fft(y);

% Pre-allocate results of integration.
Y = zeros(size(omega)); 

%Integrate.
for k=1:length(omega)
    Y(k) = trapz(t, exp(-t.^2./2)/sqrt(2*pi).*exp(1j*omega(k).*t)); 
end

figure()
plot(omega, real(Y), omega, imag(Y));

figure()
plot(omega, real(Yft), omega, imag(Yft));
There are two reasons why you get different results. The first is that you define a vector t between $-10$ and $10$, but the fft command doesn't know that. So the data are interpreted as starting at $0$. This means the first difference is that the FFT computes the transform of a delayed Gaussian impulse, not of an impulse centered at time zero. This is why you get a non-zero imaginary part in the result of the FFT.

The second problem is - as pointed out by nivag in a comment - that the first index of the result of the FFT corresponds to frequency zero, and the negative frequencies appear in the second half of the resulting vector.