how can i get a square wave in matlab ?
1 回表示 (過去 30 日間)
古いコメントを表示
I want to plot a periodic square wave in matlab and the period T has to be 3. How can i plot a sqaure wave the repeats itself every (T=3) ? help please and thank you!
0 件のコメント
採用された回答
Jos (10584)
2016 年 2 月 22 日
Something like this?
t = linspace(0,20,1000) ;
T = 3 ;
x = sign(sin(2*pi*(1/T)*t)) ;
plot(t,x,'b-')
その他の回答 (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!