MATLAB Program: t=0:0.01:2*pi; w=1; A=2; a=2*A/pi; y=0; n=input('Enter the n value'); for i=1:n y=y+a*((-1)^(i-1))*(1/i)*sin(i*w*t); i=i+1; end plot(t,y); Output: Untitled_c Enter the n value1000
No comments