how can i plot these dsp signals?

4 ビュー (過去 30 日間)
Omar Dulaimi
Omar Dulaimi 2017 年 3 月 11 日
編集済み: Walter Roberson 2017 年 3 月 12 日
i tried plotting these signals and this is the code i've used but it's not quite right
n=[1:50];
S=2*(n.*(0.9).^n)
plot(S);
x=rand(1,50);
plot(x);
q=S + x;
plot(S,x);
please help me

回答 (1 件)

Rahul K
Rahul K 2017 年 3 月 12 日
I think what you have is correct, except in the last command you should be plotting q rather than S and x. Also if you want all the lines to appear on the same figure, you need to plot them together or hold the figure.
figure
hold on
n=1:50;
x=rand(size(n));
plot(x,'r');
S=2*(n.*(0.9).^n);
plot(S,'b--')
q = S+x;
plot(q,'r-.');
legend('x', 'S', 'q');

カテゴリ

Help Center および File ExchangePole and Zero Locations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by