How to get the modulus of complex symbolic expression?

15 ビュー (過去 30 日間)
Raptrick
Raptrick 2017 年 11 月 15 日
コメント済み: Raptrick 2017 年 11 月 15 日
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 Center および File ExchangeLinear Algebra についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by