Plotting a train pulse
3 ビュー (過去 30 日間)
古いコメントを表示
Hello!!
I need to plot differents square waves changing the frecuency for later on compute the fft and see how it changes. The problem is that I dont know how to plot a function that from 0-Tc/2 is 1 and from Tc/2-Tc is -1. One that I clear that, I need to compute another function that is 1 for 0-Tc/4, -1 for Tc/4-Tc/2 , 1 for Tc/2-3Tc/4 , -1 for 3Tc/4-Tc
and then so on, to see how the frecuency change affect to the fft. So I have to be able to compute the fft of the function, so I think that I cant define just vector and plot them. I am a little bit lost, I will appreciate any help Thanks in advance, Nicolas
0 件のコメント
回答 (3 件)
Masoud Ghanbari
2012 年 3 月 15 日
Hi Nic I think i've got your mean.you need a plot which has a clamp just like unit step.you can plot it by vectors.here is a code of unit step.you can change it into what you want just by changing numbers
u=[ 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 ]; t=[-10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0 0 2 3 4 5 6 7 8 9 10]; plot(t,u); axis([-10 10 -1 2])
the point is that we have 2 values in t=0 and it is a clamp. Hope it works
0 件のコメント
Masoud Ghanbari
2012 年 3 月 15 日
Lets see...
for t=(-10:.01:10)
if t<0
plot(t,0,'linewidth',5);
hold on;
else t>=0;
plot(t,1,'linewidth',5)
hold on
end
end
axis([-10 10 -2 2])
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Waveform Generation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!