How to plot a function over a time interval in specific time increments?

조회 수: 91 (최근 30일)
Quant.Phys42
Quant.Phys42 2019년 9월 19일
댓글: madhan ravi 2019년 9월 22일
xt = @(t) sin(pi*t);
>> fplot(xt,[0 20], 'MeshDensity',100)
>>
Gives me a plot of a function of time over a time interval; how would i plot in this function in specific time increments (time steps)?

답변 (1개)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2019년 9월 20일
Hi,
Here is the plain answer:
xt = @(t) sin(pi*t);
dt = pi/100;
t = 0:dt:20;
plot(t, xt(t))
  댓글 수: 2
Quant.Phys42
Quant.Phys42 2019년 9월 22일
How do i change the time increments?
madhan ravi
madhan ravi 2019년 9월 22일
Sulaymon Eshkabilov comments:
change dt that is the time increment, e.g. in order to take 0.01 time step, dt = 0.01. That is all. Good luck.

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

카테고리

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

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by