MATLAB Answers

0

How to get 2 discrete signals into 1 graph?

Asked by Notname Notname on 30 Jun 2019
Latest activity Commented on by Star Strider
on 30 Jun 2019
Basically i need to graph this signal but I graph it part by part:
x[n]={-3n*(n^n-5), 3<=n<6
2, 0<=n<3
0, for every other n
>>n1=[0 1 2];
>> x1=[2 2 2];
>> stem(n1,x1)
>> hold
Current plot held
>> n2=[3 4 5];
>> x2=-3.*n2.*(n2.^n2-5);
>> stem(n2,x2)
But this does not work. Can i even do it part by part or is there more efficient way to draw this signal?

  5 Comments

It plots correctly. The magnitude of ‘x2’ obscures the details:
figure
n1=[0 1 2];
x1=[2 2 2];
stem(n1,x1)
axis([-1 6 -1 3])
Oh okay, thank you very much.
My pleasure.

Sign in to comment.

Tags

0 Answers