Instead of rolling your own try resample. Basically what you are trying to do has already been done a million times before and perusal of matlab's help files will get you the right answer.
RESAMPLE Change the sampling rate of a signal.
Y = RESAMPLE(X,P,Q) resamples the sequence in vector X at P/Q times
the original sample rate using a polyphase implementation. Y is P/Q
times the length of X (or the ceiling of this if P/Q is not an integer).
P and Q must be positive integers.
RESAMPLE applies an anti-aliasing (lowpass) FIR filter to X during the
resampling process, and compensates for the filter's delay. The filter
is designed using FIRLS. RESAMPLE provides an easy-to-use alternative
to UPFIRDN, relieving the user of the need to supply a filter or
compensate for the signal delay introduced by filtering.
In its filtering process, RESAMPLE assumes the samples at times before
and after the given samples in X are equal to zero. Thus large
deviations from zero at the end points of the sequence X can cause
inaccuracies in Y at its end points.
Cheers
Greg Locock
SIG

lease see FAQ731-376 for tips on how to make the best use of Eng-Tips.