MATLAB: How does the FFT zero pad

ffthilbert

I am using the Hilbert function for an analysis, and I would like to use the FFT method to get the imaginary part. What I am unsure of is how the FFT function is zero padding? I would like there to be an even number of zeros on each end of my data so that when I apply a window, my data are centered. Any help on this would be greatly appreciated.
example of code I'm using (i've attached an example mat file with the variable "prox")
a= hilbert(hann(length(prox)).*prox,2^8);

Best Answer

Y = fft(X,n);
is the same as
Xp=X;
Xp(length(X)+1:n)=0;
Y=fft(Xp);