I have tried to plot the function below from (0,pi) for a0 and the first six terms of the series on matlab. I did not know how to include the sin and cos function together so I tried to plot the cos term first, However, it seems like it does not work with the followig code becaue of (cos, sin) error. I would appriciate your help.
a0 = pi/4
an = 1/pi(cos(n*pi)-1)
bn = (-1*cos(n*pi))/n
f(t) = a0 + sum(an*cos(n*t))+ sum(bn*sin(n*t))
an = -1/pi(cos(i*pi)-1) ;