Creating a rectangular pulse
조회 수: 88 (최근 30일)
이전 댓글 표시
I can create an rectangular pulse with code
b1 = 5;
a1 = 5;
x = -10:0.01:10;
% a pulse function
f = @(xi,a,b) a*rectpuls(xi,b);
% plot to
plot(x,f(x,a1,b1),'b--');
title(['Rectangular Pulse']);
xlabel('Time');
ylabel('Amplitude');
I now want to move this pulse, to start from x = -2 and end at x=+3, i.e. not have it centred around zero?
Any idea how to make it so?
댓글 수: 0
채택된 답변
Mischa Kim
2017년 10월 12일
captain, how about
plot(x,f(x-0.5,a1,b1),'b--');
댓글 수: 2
Elijah Uche
2020년 10월 20일
Hi Mischa Kimm and Captain Mariah,
Please I need help with the fft of that rectangular pulse as well as its power spectral density
How do I also extract the bandwidth from the PSD?
Kindly assist, any hints/clues will be appreciated
Thanks
Elijah
추가 답변 (1개)
ahmed khouaja
2021년 11월 26일
b1 = 5;
a1 = 5;
x = -10:0.01:10;
% a pulse function
f = @(xi,a,b) a*rectpuls(xi,b);
% plot to
plot(x,f(x,a1,b1),'b--');
title(['Rectangular Pulse']);
xlabel('Time');
ylabel('Amplitude');
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!