Discrete Time Plotting x[n]+x[-n] Using Stem
8 ビュー (過去 30 日間)
古いコメントを表示
Hello, I have a signal which is u[n]-u[n-1], where n is 0<n<5. I need to plot the graph of x[n]+x[-n]. I can plot them like x[n] and x[-n] but I can not plot their summation.
!! I MEAN IT DOES NOT SHOW ME THE RESULTS BEFORE 0, IT JUST SHOWS ME THE VALUES AFTER 0 !!
How can I do it? Thanks for your sugggestions.
2 件のコメント
Setsuna Yuuki.
2020 年 11 月 12 日
Did you try using hold on?
stem(x[n]); hold on;
stem(x[-n]);
stem(x[n-5]);
回答 (1 件)
matt
2022 年 12 月 1 日
編集済み: matt
2022 年 12 月 1 日
The question is unclear in definiton of signal. assuming x[n] = u[n]-u[n-1], u[n] is heavyside function, function to plot is y[n] = x[n]-x[-n]
nn = (eps:.1:5-eps); %eps starts interval just right of zero and ends interval just right of interval
syms n
u = heaviside(n); % define u
x = subs(u,n,nn) - subs(u,n,nn-1);
x2 = subs(u,n,-nn) - subs(u,n,-nn-1);
stem(nn,x+x2) % plot y
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Polynomials についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!