It can can be done by creating a signal which would be 1 during the interval of integration and 0 otherwise.
https://in.mathworks.com/matlabcentral/newsreader/view_thread/283743
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!