plot multiple discrete graphs on the same figure

812 Views Asked by At

having troubles using 3 stem function on the same figure. my code (only for the plot part) is:

figure(1)
stem(s,'*');
hold
stem (v,'kx');
hold
stem(x,'color',([0 0.5 0]));
title('the discrete signals');
xlabel('n');
ylabel('signal value');
legend('s[n]','v[n]','x[n]');

how can I fix that?

1

There are 1 best solutions below

0
On BEST ANSWER

"hold" toggles the hold state between on and off.

So the first instance toggle "hold on" the second "hold off", so you should only see the last plot.