title: How do I plot the sum of two discrete time signal for different time index?
body: <p>How can I sum two discrete time signals with different time index, ie. given a first signal <code>x=[1 2 3 4 5]</code> at time indices <code>n1=-3:1</code>, and a second signal <code>y=[1 1 2 2 3]</code> at time indices <code>n2=0:4</code>.
  I can't just add these two signals since their length differ. So far my code is:</p>
  
  <pre><code>n1=-3:1;
  x=input('Enter the value of X:');
  y=input('Enter the value of Y:');
  subplot(3,1,1);
  stem(n1,x);
  grid on;
  xlabel('Time index');
  ylabel('Amplitude');
  axis([-10 10 0 10]);
  title('signal X');
  
  
  n2=0:4;
  subplot(3,1,2);
  stem(n2,y);
  grid on;
  xlabel('Time index');
  ylabel('Amplitude');
  axis([-10 10 0 10]);
  title('signal Y');
  </code></pre>
  
  <p>What should I do next? How can I proceed to add these two signals?</p>