Plotting the summation of a Heaviside step function

So I have written a script where I want to plot the summation of a Heaviside function, which equals this i.e :
where are real positive parameters with and u as real variable.
In the script i wrote i took as and u as x as follows :
n=7
m=0:0.5:24;
ms=size(m);
x=-20:2.5:100;
xs=size(x);
S=0;
for i=1:25
s(i)=heaviside(x(i)-m(i));
S=S+s(i);
end
S
plot(x,S)
However, it plots a straight line of dots with jumps in between which kept me wondering if this is right or wrong.
In my initial idea, I wanted to represent this problem with a symbolic math toolbox but I got lost doing that too, I would appreciate it if anyone could give me a hint on how to write one ?.

Respuestas (0)

Categorías

Más información sobre Mathematics en Centro de ayuda y File Exchange.

Preguntada:

el 29 de Abr. de 2020

Editada:

el 29 de Abr. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by