MATLAB: How can i write the code in a m-file that can take any periodic function and calculate its fourier series expantion using matlab

fourier seriressinx

for example f(x)=sin(x)
Related Question