How to generate square wave in matlab with frequency,​amplitude,​voltage offset,dutycycle?

24 ビュー (過去 30 日間)
Hi, I want to generate square wave with frequeency=10/200e-6,amplitude=3.3,voltageoffset=0 and duty cycle=50. can anyone help me with this. Thank you.

採用された回答

Birdman
Birdman 2018 年 1 月 24 日
編集済み: Birdman 2018 年 1 月 24 日
There is square function for it to be used. Consider the following approach:
freq=10/200;
offset=0;
amp=3.3;
duty=50;
t=0:0.01:100;%100 seconds
sq_wav=offset+amp*square(2*pi*freq.*t,duty);
plot(t,sq_wav)
  5 件のコメント
Juan Jiménez
Juan Jiménez 2021 年 11 月 10 日
3.3 is the amplitude
Emilia Robles
Emilia Robles 2022 年 1 月 21 日
what are the untis of each? Not sure if the amp here is VPP or just Vp

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

その他の回答 (0 件)

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by