I plotted the series in MatLab and got a result that points in an other direction. :-(
Originally Posted by CaptainBlack
Here's the plot I got and the MatLab code I wrote.
The function I was aiming for is 1-t and it should hold the points [0,1] and [2,-1] and then jump to next 'slope'. Eh, right?
N = 20;
x = (-50:50)/20; %interval : [-2.5,2.5]
f = ones(1,101);
%Odd fourier, no a_0 and a_i included.
for i = 1:1:N %from 1 to N
f = f + (2 * sin(pi*i*x)) / (i * pi); %sum all terms over N iterations.
I guess my question is, is it the series or is the MatLab tinkering that's wrong..?