How to calculate integral of a square waveform
조회 수: 14 (최근 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!