I'm doing some fourier transforms and I'm wondering how to plot this in Matlab to look at the graphs. I don't know how to plot the function, nor the series.
; , for all x.
which has the fourier series (if calculated correctly):
I'd like to do a comparison of the Fourier-series and the original function by looking at the graphs. Also, how do you find the Fourier-series and their coefficients, from a function like the one I posted? It'd be great to use Matlab for that.
Any help would be appreciated
By that I assume you mean the partial sums, then yes:
and if you want this on the same plot as the other use "hold on" before the second plot (and "hold off" after the second).Code:x=0:pi/100:2*pi n=1:5; [N,X]=meshgrid(n,x); S=sin((2*N-1).*X)./(2*N-1); SS=sum(S'); plot(x,SS);
CB