I understand you're looking to generate an OFDM signal using MATLAB. To get started, I recommend you to check out the following MATLAB documentation, which explains the theory behind OFDM modulation:
In MATLAB, you can simulate OFDM modulation using the 'ofdmmod' function from the Communications Toolbox. This function allows you to set properties such as the number of data/pilot subcarriers and the number of symbols. Below is a simple example that demonstrates how to perform OFDM modulation on a 4-QAM signal with a cyclic prefix length of 16 and 64 data subcarriers:
M = 4; % Modulation order
nfft = 64; % Number of FFT points
cplen = 16; % Cyclic prefix length
nSym = 5; % Number of symbols
dataIn = randi([0 M-1], nfft, nSym);
qamSig = qammod(dataIn, M, 'UnitAveragePower', true);
y1 = ofdmmod(qamSig, nfft, cplen);
Alternatively, you can use the Wireless Waveform Generator to easily create an OFDM waveform. The default waveform is OFDM, and you can open the app with the following command:
>>wirelessWaveformGenerator
For more details on the 'ofdmmod' function, you can refer to the following documentation:
Hope this helps!