Impact-Site-Verification: dbe48ff9-4514-40fe-8cc0-70131430799e

Search This Blog

Demonstration of Fourier series of Saw tooth wave in MATLAB

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

Popular Posts

Followers