title: How do i create my own convolution code on Matlab without using the built-in function
body: <p>I am trying to create a program on Matlab to show the convolution of 2 signals but without using the 'conv' function.</p>
  
  <p>The input is  ()=xp(-4t+4)*(−1)+0.5(−5)+2(−10) </p>
  
  <p>I have worked out that h(t) = 4*exp(-4t)*u(t). I am trying to make a program on MATLAB to compute and display the convolution of two arrays representing two signals but without using the built-in 'conv' function.
  I have a working code but it includes 'conv' and so I am trying to do it without using this.</p>
  
  <pre><code>t=linspace(0,11,1101);  
  
  %create more than 500 time-series values
  
  vs=exp(-4*(t-1)).*heaviside(t-1)+0.5*heaviside(t-5)+2*dirac(t-10);
  
  %Input signal array
  
  h=4*exp(-4*t).*heaviside(t);
  
  %Input signal array
  
  vc=conv(vs,h);
  
  t1=linspace(0,22,2201);
  
  %Convolution of two arrays
  
  subplot(3,1,1)
  
  plot(t,vs)
  
  xlabel('t')
  
  ylabel('v_s(t)')
  
  title('Input signal')
  
  subplot(3,1,2)
  
  plot(t,h)
  
  xlabel('t')
  
  ylabel('h(t)')
  
  title('System impulse response')
  
  subplot(3,1,3)
  
  plot(t1,vc)
  
  xlabel('t')
  
  
  ylabel('v_c(t)')
  
  title('Output signal')
  </code></pre>