How to calculate BW ofdm?
I don't think it's possible to deduce the sampling rate from this information. The sampling rate could be anything, since FFT is sampling rate agnostic. Sampling rate is pretty much independent of all other parameters which scale directly with it.

Concerning the bandwidth, it's not clear either. You're specifying pilot distance, but we don't know what the units are and we never see how those variables get used. Is there more to the code you're studying?



Looked at your full code, and the sampling rate is 8 kHz, since that's what frequency is used in the wavwrite command. Will have to get back to bandwidth.