How to get the modulus of complex symbolic expression?

15 次查看(过去 30 天)
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

采纳的回答

Walter Roberson
Walter Roberson 2017-11-15
rewrite(zabs, sqrt)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Linear Algebra 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by