Plotting the summation of a Heaviside function
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
How to plot the summation of a this Heaviside function, i.e :
where
are real positive parameters with
and u as real variable.
2 commentaires
Toder
le 7 Mai 2020
Hi Gill, what have you tried so far? Is n fixed? It may be helpful to expand the summation on paper to better see what's going on. You can also plug in some sample points to get an idea of how the function behaves. Let's call the whole summation
. Without even choosing values for
we can figure out what S is for choices of μ. Three interesting ones to compute might be
Taking the time to figure these out will let us check the final plot once we make it. The documentation for the Heaviside function in Matlab can be found here.
Réponse acceptée
Ameer Hamza
le 7 Mai 2020
Try this
mu = sort(rand(5,1)); % random vectors of 5 \mu values in ascending order
x = linspace(0,1,1000); % values on x-axis
y = sum(heaviside(x-mu)); % command to create vector of heaviside and summing them
plot(x, y)

5 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Creating, Deleting, and Querying Graphics Objects dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
