plot or stem the length of negative and positive signal?

1 vue (au cours des 30 derniers jours)
abdullah qasim
abdullah qasim le 26 Fév 2019
Commenté : abdullah qasim le 26 Fév 2019
I follow positive and negative references
XNsize = length (Xn);
[XNsize, Xn, Xp]
I want to plot the signal by using "stem" as follow
stem([XNsize, Xn, Xp])
but in different colours
meaning
Xn in red
Xp in blue

Réponse acceptée

KSSV
KSSV le 26 Fév 2019
y1 = rand(10,1) ;
x1 = 1:length(y1) ;
y2 = rand(15,1) ;
x2 = [1:length(y2)]+length(y1) ;
figure
hold on
stem(x1,y1,'r')
stem(x2,y2,'b')
legend('x1','x2')

Plus de réponses (1)

madhan ravi
madhan ravi le 26 Fév 2019
stem(repmat(XNsize,XNsize,1),[Xn, Xp])

Catégories

En savoir plus sur Applications dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by