Effacer les filtres
Effacer les filtres

Generating Discrete time Rectangular wave

16 vues (au cours des 30 derniers jours)
ong
ong le 20 Avr 2013
I would like to generate rectangular wave through matrices. I am able to generate triangular signal by :
tri=[0 1/3 2/3 1 2/3 1/3 0 0];
Any idea on how to generate a rectangular wave in this method? thanks.

Réponses (1)

Azzi Abdelmalek
Azzi Abdelmalek le 20 Avr 2013
t=-10:0.01:10;
y=heaviside(t+5)-heaviside(t-5),
plot(t,y)
  1 commentaire
Azzi Abdelmalek
Azzi Abdelmalek le 20 Avr 2013
If you do not have heaviside function use
t=-10:0.01:10;
echelon=@(x) (1+sign(x))/2
y=echelon(t+5)-echelon(t-5),
plot(t,y)

Connectez-vous pour commenter.

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by