(a) To plot x(n), we have the values 0, 1, -1. We can create a vector for the x-axis values and a vector for the y-axis values.
x = [0, 1, -1];
n = 1:length(x);
subplot(2,2,1);
stem(n, x);
xlabel('n');
ylabel('x(n)');
title('(a)');
(b) To plot y(n), we have
Show more…