To calculate fft the signal should be discrete. You should first sample your signal. Use t=nTs, where Ts is the sampling time. Calculate X(n) for n=1:N, where N is required number of samples. Then you can give this array to fft function.
I have attached a sample script of the same.You can tune the parameters to get the required spectrum. Please have a look at the following documentation for more details.