How to simplify a symbolic expression sum of terms involving the Heaviside function

8 Ansichten (letzte 30 Tage)
sympref('HeavisideAtOrigin', 1);
syms m n
assume(n, {'positive','integer'})
s(n) = simplify(symsum(heaviside(m), m, [0, n]), 50)
ans = 
How to obtain the symbolic sum ?

Akzeptierte Antwort

Dyuman Joshi
Dyuman Joshi am 28 Feb. 2024
For that you have to assume the same for 'm' as well -
sympref('HeavisideAtOrigin', 1);
syms m n positive integer
s(n) = symsum(heaviside(m), m, [0, n])
s(n) = 
  2 Kommentare
Mohamed
Mohamed am 28 Feb. 2024
Bearbeitet: Mohamed am 28 Feb. 2024
Thanks a lot
% clear
sympref('HeavisideAtOrigin', 1);
syms n positive integer
syms m
s(n) = symsum(heaviside(m), m, [0, n])
s(n) = 
assume(m,"positive")
s(n) = symsum(heaviside(m), m, [0, n])
s(n) = 

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by