document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. %------------------------------------------------------------------------------------------------
  2. % ASSIGNMENT NO : 1
  3. % TITLE : Find the output of given system for given input sequence using linear convolution in MATLAB.
  4. %------------------------------------------------------------------------------------------------
  5.  
  6. clc
  7. x=[1,1,1,1,1];
  8. h=[1,2,3,4,5];
  9. m=length(x);
  10. n=length(h);
  11. y=zeros(1,m+n-1);
  12. h=[h,zeros(1,m)];
  13. x=[x,zeros(1,n)];
  14. for i=1:m+n-1
  15. y(i)=0;  
  16.     for j=1:m+n-1    
  17.             if j<i+1        
  18.                     y(i)=y(i)+x(j)*h((i-j)+1);        
  19.             end
  20.     end
  21. end
  22. y
  23. stem(y);
  24. grid on;
');