%
% Filename: example8.m
%
% Description: This m-file convolves two signals and plots the result.
%
x = [0.5 0.5 0.5]; % define input signal x[n]
h = [3.0 2.0 1.0]; % define unit-pulse response h[n]
y = conv(x,h); % compute output y[n] via convolution
n = 0:(length(y)-1); % create n-vector for plotting y[n]
stem(n,y,'filled'); % plot y[n]
xlabel('n');
ylabel('y[n]');
title('System Output Via Convolution');
MATLAB Plot Generated: