%The function
clc; clear all;c=4/pi;w=2*pi;dt=0.001;tpts=(5/0.001)+1;for n= 1:50 for m=1: tpts S1(n,m)=(4/pi)*(1/(2*n-1))*sin((2*n-1)*w*dt*(m-1)); end endfor m=1: tpts S2=S1(:,m); S3(m)=sum(S2);endf1=S3;t=0.0:0.001:5 ;plot(t,f1);t=xlabel('time,[s]');f1=ylabel('Amplitude,V');
grid;
Best Answer