How to calculate integral of a square waveform
38 次查看(过去 30 天)
显示 更早的评论
Hi,
Could you please let us know how to calculate integral of a square waveform using Matlab
0 个评论
采纳的回答
Ameer Hamza
2018-8-10
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)
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!