How to sum a series of functions and then plot the sum?
Afficher commentaires plus anciens
This function is supposed to be able to plot a box filter:

That should possibly look like this:

I already defined t as a 1x360 double array using:
t = t = linspace(0, 4, 360)
syms k
z = symsum( (1 / k) * sin((2 * pi) * k * t ), k, 1, 10) ;
It returns a 1x360 sym variable, but I don't know how to plot it.
3 commentaires
Stephen23
le 1 Mar 2018
@Shaun Pedicini: Is there a particular reason why you need to use symbolic math?
Shaun Pedicini
le 1 Mar 2018
Walter Roberson
le 1 Mar 2018
Z = double(z);
plot(t, Z)
Your MATLAB is detecting that the input is sym and is doing the double() on your behalf, but you can make what you are doing more obvious by doing the double() yourself.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Mathematics dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!