how can plot such a signal s(-t-5)?
2 ビュー (過去 30 日間)
古いコメントを表示
can anyone help me to make such a signal s(-t-5) from signal s? I have tried the following code: fliplr([zeros(1,5) s]) Is it right?
0 件のコメント
採用された回答
Abhiram Bhanuprakash
2015 年 5 月 20 日
Hi sH,
I think your approach is right, and it accounts for the Y axis values.
But, for the X axis indices, I think you should do something like this:
Say you have a signal s(n) = [1 2 3 4], and you wish to obtain s1(n) = s(-n-5):
s = [1 2 3 4];
inds = 0:length(s)-1;
figure, plot(inds,s); %considering time index 0 as the origin
s1 = fliplr([zeros(1,5) a]);
flippedInds = -(length(s1)-1):0;
figure, plot(flippedInds,s1);
Hope this helps,
Cheers!
Abhiram.
3 件のコメント
Abhiram Bhanuprakash
2015 年 5 月 20 日
Oops, sorry, my mistake.
It should be
s1 = fliplr([zeros(1,5) s]);
Thanks Walter for pointing it out.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Get Started with MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!