필터 지우기
필터 지우기

How the rectangular pulse will be after subtraction A minus B ??

조회 수: 4 (최근 30일)
Tariq Alhatmi
Tariq Alhatmi 2022년 3월 14일
답변: Moksh 2023년 10월 31일

답변 (1개)

Moksh
Moksh 2023년 10월 31일
Hi Tariq,
I understand that you are trying to generate two rectangular pulses "∏(t-2)" and "∏((t-1)/3)" and then plot their difference.
You can try generating a time series and then use logical indexing to generate square pulse. Then their difference can be plotted using the “plot” function in MATLAB.
Here is an example code for this:
% Generate a time vector
t = 0:0.01:10;
% Generate the square pulse (t-2)
A = (t >= 2) & (t < 3);
% Generate the square pulse (t-1)/3
B = (t >= 1/3) & (t < 2/3);
% Combine the two square pulses
resultant_pulse = A - B;
% Plot the combined pulse
figure;
plot(t, resultant_pulse);
xlabel('t');
ylabel('Amplitude');
title('A - B');
For more information about the “plot” function please refer to the following link:
I hope this information helps resolve the query.
Best Regards,
Moksh Aggarwal

카테고리

Help CenterFile Exchange에서 Pulse and Transition Metrics에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by