How to transform lowpass fir filter to bandpass fir filter without using a built in function in matlab
Mathematically, applying a FIR with impulse response $h_\mathrm{lpf}[n]$ to digital signal is convolution:

$y = x * h_\mathrm{lpf}$, or thanks to the properties of the (discrete) Fourier transform,

$Y = X\cdot H_\mathrm{lpf}$, as convolution becomes multiplication.

Now, making a bandpass out of a low pass can be modeled by shifting the Frequency response $H_\mathrm{lpf}$ in frequency domain. "Shifting" can be represented by a convolution of the low pass filter with a dirac impulse at the desired center frequency:

$H_\mathrm{bpf}= H_\mathrm{lpf} * \delta_{f_\mathrm{center}} $

Again, convolution becomes multiplication when transformed to time domain. The inverse (discrete) Fourier transform of a dirac at ${f_\mathrm{center}}$ is a complex oscillation $e^{2\pi{f_\mathrm{center}}n}$, so this becomes

$y[n] = x * (h_\mathrm{lpf} \cdot e^{2\pi{f_\mathrm{center}}n})$