Guest User

Untitled

a guest
Jan 21st, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. t1=(0:0.0001:0.5);
  2. x1 = 1 - 2.*t1;
  3.  
  4.  
  5. x5 = 0.25
  6. for n = 1:5
  7. x5 = x5 + [(2.*(1-cos(pi.*n)).*(1/(2.*(pi^2).*(n^2)))) - (2.*j/(2.*pi.*n))].*exp(j.*n.*2.*pi.*t1);
  8. end
  9.  
  10. x50 = 0.25
  11. for n = 1:50
  12. x50 = x50 + [(2.*(1-cos(pi.*n)).*(1/(2.*(pi^2).*(n^2)))) - (2.*j/(2.*pi.*n))].*exp(j.*n.*2.*pi.*t1);
  13. end
  14.  
  15. t2=(1:0.0001:1.5);
  16.  
  17. plot(t1,x1,t1,x5,t1,x50, t2,x1,t2,x,t2,x50)
  18.  
  19. axis([0 2 -1 2])
  20.  
  21. grid on
Add Comment
Please, Sign In to add comment