Hello people,
Been racking my brain with this one. I need to write a data sequence that results in the graph below. I think I'm supposed to somehow use the unit step function and discrete delta function. I just have a really hard time figuring out how to start and what functions to manipulate.

 채택된 답변

Ameer Hamza
Ameer Hamza 2020년 11월 5일
편집: Ameer Hamza 2020년 11월 5일
Yes, unit step can be used here:
t = -10:10;
u_step = @(x) 1*(x>=0);
y = u_step(t+2) - u_step(t-5);
stem(t, y)

댓글 수: 3

How can I make it so that the end points don't touch the end of the plot?
Nevermind, I realized its using the axis([]) command
yes, xlim() and axis(), both will work here.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

KSSV
KSSV 2020년 11월 5일
x = -5:1:10 ;
y = zeros(size(x)) ;
y(x > -3 & x < 6) = 1 ;
stem(x,y)

카테고리

도움말 센터 및 File Exchange에서 Electrophysiology에 대해 자세히 알아보기

태그

질문:

2020년 11월 5일

댓글:

2020년 11월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by