How to calculate integral of a square waveform
30 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Ashwini Amin
le 10 Août 2018
Commenté : Ashwini Amin
le 24 Août 2018
Hi,
Could you please let us know how to calculate integral of a square waveform using Matlab
0 commentaires
Réponse acceptée
Ameer Hamza
le 10 Août 2018
You can use the square() function to create a square wave with the time period of 2*pi and amplitude between -1 and 1. And then use trapz() to evaluate the integral numerically. For example
t = 0:0.1:10; %%choose the range you want
y = square(t);
trapz(t,y)
2 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Numerical Integration and Differentiation 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!