Advertisement
szymcio93

1a

Oct 6th, 2015
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. close all;
  2. clear all;
  3.  
  4. A=230;
  5. f=50;
  6. t=0.1;
  7. fs1=10000;
  8. fs2=500;
  9. fs3=200;
  10.  
  11. counter=1;
  12.  
  13. w=2*pi*f;
  14.  
  15. for i=0:1/fs1:t
  16. x1(counter)=i;
  17. y1(counter)=sin(w*i);
  18. counter=counter+1;
  19. end
  20.  
  21. counter=1;
  22.  
  23. for i=0:1/fs2:t
  24. x2(counter)=i;
  25. y2(counter)=sin(w*i);
  26. counter=counter+1;
  27. end
  28.  
  29. counter=1;
  30.  
  31. for i=0:1/fs3:t
  32. x3(counter)=i;
  33. y3(counter)=sin(w*i);
  34. counter=counter+1;
  35. end
  36.  
  37.  
  38. hold on
  39.  
  40. plot(x1,A*y1,'b-')
  41. xlabel('second')
  42. ylabel('Volt')
  43. plot(x2,A*y2,'ro')
  44. plot(x3,A*y3,'kx')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement