PLotting matlab noisy signal

Suppose we have some noise signal that's a function of time.
Suppose at t = pi/2, 3pi/4, 5pi/4 I want to mark where exactly, at these time points, the signal is. How would you do this? Is there a toolbox I can use?
If not, what would I have to do to manually input the values of 'y' for each corresponding 't' ?

 採用された回答

Wayne King
Wayne King 2012 年 10 月 24 日

0 投票

Do you know the sampling interval for the time signal? Suppose the sampling interval is pi/100.
t = 0:pi/100:40;
x = cos(pi/10*t)+0.5*randn(size(t));
plot(t,x)
Then you know where pi/2, 3pi/4 etc are.
t(50) is pi/2 and x(50) is the signal value at t=pi/2
plot(t,x); hold on
plot(t(50),x(50),'r^','markerfacecolor',[0 0 0],'markersize',10);
plot(t(75),x(75),'r^','markerfacecolor',[0 0 0],'markersize',10);
and so on.

1 件のコメント

T
T 2012 年 10 月 24 日
Suppose t was a vector and for each element is the one that I want to plot, so for instance, t(1), t(2),..., and so on. How would you do this?

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeLine Plots についてさらに検索

タグ

質問済み:

T
T
2012 年 10 月 24 日

Community Treasure Hunt

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

Start Hunting!

Translated by