How to apply Hamming Window? I am new in matlab and signal processing. The time series that have been used are obtained from accelerometer in a building. As far as I understand both the time series' length and window function length(hamming or hanning) should be same. But for smoothing the fourier amplitude spectrum, optimum window length can vary. How this procedure should be apply in matlab?

How can apply a window function that is shorter than my time series.

Thanks for reading!
The window length should be equal to your transform length, not necessarily the length of your entire data set.  The two are the same, of course, if you are going to transform the entire data set at once, but if you are planning to do shorter transforms then you should make the window length equal to the length of those transforms.