How to get the modulus of complex symbolic expression?

10 Ansichten (letzte 30 Tage)
Raptrick
Raptrick am 15 Nov. 2017
Kommentiert: Raptrick am 15 Nov. 2017
Dear all,
I want to calculate the modulus of complex symbolic expression but I do not get explicit results:
syms a b;
assume(a>0);
assume(b>0);
z = a + sqrt(-1)*b;
zabs = abs(z)
Results in:
zabs =
abs(a + b*1i)
I was expecting zabs = (a^2 +b^2)^(1/2). How do I get the result I want?
Patrick

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 15 Nov. 2017
rewrite(zabs, sqrt)

Weitere Antworten (0)

Kategorien

Mehr zu Symbolic Math Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by