how do plot x(n)=u(n-2)-u(n-5)

조회 수: 31 (최근 30일)
mehdi s
mehdi s 2022년 11월 3일
답변: Ghadeer 2023년 10월 12일
hello i need plot for signal x(n)=u(n-2)-u(n-5) thanks.

채택된 답변

Maik
Maik 2022년 11월 5일
n = (-20:20);
u_n = n>=0;
u_n_2 = n>=2;
u_n_5 = n>=5;
u_diff = u_n_2 - u_n_5;
subplot(3,1,1); stem(n,u_n_2);xlim([-15 15]); ylim([-2 2])
subplot(3,1,2); stem(n,u_n_5);xlim([-15 15]); ylim([-2 2])
subplot(3,1,3); stem(n,u_diff);xlim([-15 15]); ylim([-2 2])

추가 답변 (1개)

Ghadeer
Ghadeer 2023년 10월 12일
X(n) = u(n) + 2u(n-1)+u(n-4)

카테고리

Help CenterFile Exchange에서 Subplots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by