why does Matlab not expand(abs(a-b)^2) ?
1 次查看(过去 30 天)
显示 更早的评论
Wolfram alpha shows: a^2 -2*a*b+b^2
0 个评论
采纳的回答
Walter Roberson
2020-10-14
>> a=complex(rand,rand)
a =
0.0975404049994095 + 0.278498218867048i
>> b=complex(rand,rand)
b =
0.546881519204984 + 0.957506835434298i
>> abs(a-b)^2
ans =
0.662960138288077
>> a^2-2*a*b+b^2
ans =
-0.259145264457063 + 0.610212976647027i
2 个评论
更多回答(0 个)
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!