Fourier Transform within a certain Limit
So, your integral with bounds 

$$X(f) = \int_{a}^b x(t) e^{-i2\pi ft}\,dt$$ 

could really be written as 

$$X(f) = \int_{-\infty}^\infty (r_{a,b}(t)\cdot x(t)) e^{-i2\pi ft}\,dt$$ 

with $r_{a,b}(t) = \begin{cases}1 &amp; a&lt;t\le b\\0&amp;\text{else,}\end{cases}$  i.e. as a "windowed" view at $x(t)$.

Luckily, the convolution theorem of the Fourier transform allows us to say that 

$$\mathcal F\{r_{a,b}\cdot x\} = \mathcal F\{r_{a,b}\}*F\{x\}$$
with $*$ being the convolution operator. 

Thus, you'd just need to numerically determine an estimate for the Fourier transform of $x$, $F\{x\}$, and convolve that with the Fourier transform of your window $r$. Luckily, the Fourier transform of a unity-wide rectangle is known (it's a sinc function), and you just need to apply the scale and shift theorems of the Fourier transform to convert that standard sinc to the Fourier transform $F\{r_{a,b}\}$.

Then you'd need to estimate the convolution of the two.

Assuming your signal is well-behaved (especially: band-limited), a discretized signal $x[n]$ represents your $x(t)$, and hence, you could estimate the continuous time Fourier Transform within the signal bandwidth by doing a DFT (matlab: fft()) of sufficient samples of a period of $x(t)$.

As said, finding $F\{r_{a,b}\}$ is easy to do analytically. Simply generate the same amount of samples of $F\{r_{a,b}\}$ as you did for $x(t)$, and numerically convolve the result (matlab: convolve, filter).

This might be much more effort or much less elegant or much less accurate than simply doing numeric integration, which matlab can also do out of the box. But I'm assuming you're not interested in that, because a) it's trivial to find "matlab numerical integration" if you just look for it, so I presume you already did that and b) I'm assuming you're asking how to solve this with signal processing methods, considering the place you ask.