i am trying to plot the following Fourier series $x(t)$

t=0:0.01:2;
A = 10;
T = 2;
w0 = 2*pi/T;
N = 10;
xN = zeros(1,length(t)); % dc component
for n=1:N
xN = xN + (1/(2*n-1)) * sin(2*n -1)*w0*t;
end
x = (4*A/pi) * xN;
plot(t,x)
xlabel('t')
ylabel('x(t)')
The result must be:

My code doesn't seem to be working, any help would be much appreciated, thank you.
You can always use the symbolic toolbox - I find it nicer for doing things such as computing Fourier Series. Example code below.