plot or stem the length of negative and positive signal?

1 回表示 (過去 30 日間)
abdullah qasim
abdullah qasim 2019 年 2 月 26 日
コメント済み: abdullah qasim 2019 年 2 月 26 日
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

採用された回答

KSSV
KSSV 2019 年 2 月 26 日
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')

その他の回答 (1 件)

madhan ravi
madhan ravi 2019 年 2 月 26 日
stem(repmat(XNsize,XNsize,1),[Xn, Xp])
  1 件のコメント
abdullah qasim
abdullah qasim 2019 年 2 月 26 日
thank u .
but this method not working

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeApplications についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by