# Why these two codes produce different graphs? How can I make the second graph be like the first?

조회 수: 4 (최근 30일)
Why these two codes produce different graphs? How can I make the second graph be like the first?
1st:
t=0:0.3:10;
step(c2d(tf(1,[1 1]),0.3),t);
2nd:
t=0:0.3:10;
[y,t]=step(c2d(tf(1,[1 1]),0.3),t);
plot(t,y)
Any idea?

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

### 채택된 답변

Arnaud Miege 2011년 6월 17일
Fangjun's correct. To get the same plot, use stairs:
stairs(t,y)
HTH,
Arnaud

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

### 추가 답변 (1개)

Fangjun Jiang 2011년 6월 17일
The results are same if you see it like this.
figure;
plot(t,y,'+');
I think the reason is: you are calculating the step response of a discrete system so the plot shown in your first step() line shows the results as the value at every discrete time step. The plot shown in your plot() line is interpreted by the plot() command.
step(tf(1,[1 1]),t)

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

### 카테고리

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

### Community Treasure Hunt

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

Start Hunting!

Translated by