I understand that you want to compute Fourier synthesis using 'for' loops. The equation that you use to compute matrix 'F' creates a new matrix every time and then overwrites the previously created matrix.
To compute Fourier synthesis, you only need to use one 'for' loop. Because the 'exp' function can take vector 'n' as its input, you can first define the vector 'n' as:
>> n = 0:1:2000;
Then in the 'for' loop of variable 'k', you can use the following equation (based on what you use in the original script):
>> F = F + CC(k)*exp(1i*k*W0*Ts*n);
There is an example that shows how to approximate a square wave through Fourier synthesis. Refer to the answer provided by Youssef Khmou in the following link: