How to calculate integral of a square waveform
14 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Ashwini Amin
am 10 Aug. 2018
Kommentiert: Ashwini Amin
am 24 Aug. 2018
Hi,
Could you please let us know how to calculate integral of a square waveform using Matlab
0 Kommentare
Akzeptierte Antwort
Ameer Hamza
am 10 Aug. 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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Numerical Integration and Differentiation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!