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

53 次查看(过去 30 天)
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
Hi,
Here is the plain answer:
xt = @(t) sin(pi*t);
dt = pi/100;
t = 0:dt:20;
plot(t, xt(t))

类别

Help CenterFile Exchange 中查找有关 Mathematics and Optimization 的更多信息

产品


版本

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by