1 Attachment(s)

Plotting Fourier series approximation for a square wave using MATLAB.

Re: Plotting Fourier series approximation for a square wave using MATLAB.

Hi alexmahone! :)

Perhaps you should write

y=y+4*sin(k*x)/(pi*k);

instead of:

y=y+4*sin(k*x)/pi*k;

1 Attachment(s)

Re: Plotting Fourier series approximation for a square wave using MATLAB.

Quote:

Originally Posted by

**ILikeSerena** Hi alexmahone! :)

Perhaps you should write

y=y+4*sin(k*x)/(pi*k);

instead of:

y=y+4*sin(k*x)/pi*k;

You are just amazing!

I now get: