Effacer les filtres
Effacer les filtres

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

26 vues (au cours des 30 derniers jours)
Quant.Phys42
Quant.Phys42 le 19 Sep 2019
Commenté : madhan ravi le 22 Sep 2019
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)?

Réponses (1)

Sulaymon Eshkabilov
Sulaymon Eshkabilov le 20 Sep 2019
Hi,
Here is the plain answer:
xt = @(t) sin(pi*t);
dt = pi/100;
t = 0:dt:20;
plot(t, xt(t))
  2 commentaires
Quant.Phys42
Quant.Phys42 le 22 Sep 2019
How do i change the time increments?
madhan ravi
madhan ravi le 22 Sep 2019
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.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Line Plots dans Help Center et File Exchange

Produits


Version

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by