What Does the Symbolic Math Toolbox Mean by 0 < s When s is Complex?

조회 수: 2 (최근 30일)
Paul
Paul 2024년 2월 25일
댓글: John D'Errico 2024년 2월 25일
syms s
syms t real
f = int(exp(-s*t),t,-inf,0)
f = 
What does that first condition mean insofar as s is complex?

채택된 답변

John D'Errico
John D'Errico 2024년 2월 25일
편집: John D'Errico 2024년 2월 25일
Just test it yourself. :) Admittedly, it may not have been obvious to perform this test. But we can use it to learn how MATLAB sees that comparison.
s = sym([0, 1, -1, i, -i, 1+i, 1-i, -1+i, -1-i])
s = 
s > 0
ans = 
As you can see, a comparison with an inequality applies to the real part of a complex number. I do see that one of those cases in your question showed real(s)<0 as a comparison, but that would still be equivalent as far as MATLAB is concerned to s<0.
  댓글 수: 2
Paul
Paul 2024년 2월 25일
I think I was thrown off because the first term in the second was written with 0 < real(s), so why wouldn't the first case be written as 0 < real(s)? That's a rhetorical question.
And I've never seen that notation 0 < s -> 0 < real(s). Seems weird to me.
BUT, it is documented: lt (I should have checked that first, though not as clearly as it could be), which then brings into question why that first condition on the second case is written the way it is.
John D'Errico
John D'Errico 2024년 2월 25일
Sometimes the symbolic TB does mysterious things. :)
It is confusing that real(s)<0 and s<0 are in fact the same thing as far as the STB is concerned, yet we see both of those in different paths in the same result in your example. I assume they were generated by different pieces of code, possibly involving different people in the coding.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Conversion Between Symbolic and Numeric에 대해 자세히 알아보기

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by