How to plot a function over a time interval in specific time increments?
44 ビュー (過去 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)?
0 件のコメント
回答 (1 件)
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 件のコメント
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 Center および File Exchange で Mathematics and Optimization についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!