Advertisement
szymcio93

1b

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