Why Does int() of rectangularPulse Return NaN?

1 Ansicht (letzte 30 Tage)
Paul
Paul am 9 Jul. 2021
Kommentiert: Paul am 25 Mai 2022
syms t real
x(t) = rectangularPulse(0,1,t);
int(x(t),t,0,5)
ans = 
1
int(x(t),t,0,inf)
ans = 
NaN
int(x(t),t,-10,10)
ans = 
1
int(x(t),t,-inf,inf)
ans = 
NaN
Any ideas why those two cases return NaN?
  1 Kommentar
Paul
Paul am 25 Mai 2022
Fixed in 2022a
syms t real
x(t) = rectangularPulse(0,1,t);
int(x(t),t,0,inf)
ans = 
1
int(x(t),t,-inf,inf)
ans = 
1
int(rectangularPulse(0,1,t),-2,inf)
ans = 
1

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 9 Jul. 2021
Work-around:
syms b x t real
assume(b>=0)
y(t) = rectangularPulse(x,1,t)
y(t) = 
z = int(y,t,0,b)
z = 
limit(z, b, inf)
ans = 
  4 Kommentare
Paul
Paul am 10 Jul. 2021
Bearbeitet: Paul am 10 Jul. 2021
Just seems so strange because int() handles much more complex functions, which is just about any function, with ease. I'll see what Tech Support says about this.
Another interesting result:
syms t real
int(rectangularPulse(0,1,t),-inf,2)
ans = 
1
int(rectangularPulse(0,1,t),-2,inf)
ans = 
NaN
Walter Roberson
Walter Roberson am 10 Jul. 2021
I have a suspicion that somewhere along the way, a dirac(0) is getting invoked.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Produkte


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by