What Does the Symbolic Math Toolbox Mean by 0 < s When s is Complex?
2 次查看(过去 30 天)
显示 更早的评论
syms s
syms t real
f = int(exp(-s*t),t,-inf,0)
What does that first condition mean insofar as s is complex?
采纳的回答
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 > 0
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 个评论
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 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!