Plot wont show up

I'm trying to get this function to plot but the actual figure won't come up. The script is running but the figure itself wont come up, I tried to put figure() but still nothing
N=5;
NTime=1000;
dt = 2/NTime;
t=--dt;
for k=1:NTime
t=t+dt;
time(k)=t;
f(k)=0;
for i=1:N
f(k)=f(k)+((-2/i*pi)*((-1)^i)/sqrt((1-(2*i*pi/2))^2+(2*0.05*2*i*pi/2)^2))*sin(2*i*pi*t);
end
end
plot(time,f,'r-')
hold on
axis([0 2 -1.5 1.5])

댓글 수: 1

Star Strider
Star Strider 2019년 9월 26일
It works for me. It produces a skewed sine curve, although because of the axis call, not all of it is visible.
The full plot (not using the axis call) is:
Plot wont show up.png

답변 (0개)

이 질문은 마감되었습니다.

질문:

2019년 9월 25일

마감:

2021년 8월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by