How would I plot a piecewise summation.

10 vues (au cours des 30 derniers jours)
Ben Phelps
Ben Phelps le 27 Nov 2020
Commenté : Ben Phelps le 29 Nov 2020
Would anyone be able to help me to plot this equation in MATLAB?

Réponse acceptée

Alan Stevens
Alan Stevens le 28 Nov 2020
Something like this?
tau = 1;
t = 0:0.1:10;
n = ceil(t/tau);
for i = 1:numel(n)
S = 0;
for k = 1:n(i)
S = S + (-1)^k*(t(i) - (k-1)*tau)^k/factorial(k);
end
u(i) = 1 + S;
end
plot(t,u),grid
xlabel('t'),ylabel('u')
  1 commentaire
Ben Phelps
Ben Phelps le 29 Nov 2020
Yes thankyou so much!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Mathematics dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by