Shafayat__

Untitled

Aug 18th, 2023
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.48 KB | None | 0 0
  1. clc;
  2. clear all;
  3. close all;
  4.      
  5. t=-10:1:10;
  6. s1= t>=0 & t<=5;
  7. s2= t>=2 & t<=7;
  8.  
  9. subplot(4,1,1);
  10. stem(t,s1);
  11. xlabel('Time');
  12. ylabel('Amplitude');
  13. title('Signal 1');
  14.  
  15. subplot(4,1,2);
  16. stem(t,s2);
  17. xlabel('Time');
  18. ylabel('Amplitude');
  19. title('Signal 2');
  20.  
  21. step3 = s1+s2
  22. subplot(4,1,3);
  23. stem(t,step3);
  24. xlabel('Time');
  25. ylabel('Amplitude');
  26. title('Addition');
  27.  
  28. step4 = s1-s2
  29. subplot(4,1,4);
  30. stem(t,step4);
  31. xlabel('Time');
  32. ylabel('Amplitude');
  33. title('Subtraction');
Advertisement
Add Comment
Please, Sign In to add comment