x = [1 2 3 4];
h = [2 1 0];
y = conv(x, h);
disp('Input Sequence x[n]:');
disp(x);
disp('System Sequence h[n]:');
disp(h);
disp('Output Sequence y[n]:');
disp(y);
figure;
stem(0:length(y)-1, y, 'r');
title('Output Sequence (Convolution Result)');
xlabel('n'); ylabel('y[n]');
grid on;
To embed this project on your website, copy the following code and paste it into your website's HTML: