# why we use time step only in continuous convolution in MATLAB? But not in discrete convolution?

I am studying convolution from book of alex palamides but i am confused because he uses time step(in this case 0.01) in his code for continuous convolution as shown highlighted in attached photo but he does not uses step when he perform discrete convolution

Here is his code from book for discrete convolution

% Discrete time convolution

%  x=[1,2,3,4,5],0<=n<=4
%  h=[1,2,1],-1<=n<=1

n=-1:4;
x=[0,1,2,3,4,5];
h=[1,2,1,0,0,0];
subplot(121);
stem(n,x);
axis([-1.1 4.1 -.1 5.1]);
legend('x[n]')
subplot(122);
stem(n,h);
axis([-1.1 4.1 -.1 5.1]);
legend('h[n]')

figure
y=conv(x,h);
stem(-2:8,y)
axis([-2.5 8.5 -.5 16.5]);
legend('y[n]')


• hi! did you mean stem ? I can't see step in your code ? – Fat32 May 11 at 19:13
• this is step size – Fat32 May 11 at 19:14
• no i mean 0.01 for "step" – engr May 11 at 19:14
• but why only we use it for continuous time? – engr May 11 at 19:15
• As you also know, you cannot compute a continuous-time convolution using the digital computer. You have to approximate it and that step (size) is the discretization you apply to the continuous time so that cont. convolution is digitally computed... And you don't need a discretization step for an already discrete-time convolution... – Fat32 May 11 at 19:18