a single line of code that will take complex variables x and y and define a variable z as the phase of the product of x and y.

1 次查看(过去 30 天)
I am not able to find the answer for this as I am new to Matlab.

回答(2 个)

KSSV
KSSV 2022-6-28
x = rand+1i*rand ;
y = rand+1i*rand ;
p = x*y ;
iwant = atan(imag(p)/real(p))
iwant = -1.3234

Walter Roberson
Walter Roberson 2022-6-28
编辑:KSSV 2022-6-28
but does the angle need to be in degrees or radians? And what range?

类别

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

Community Treasure Hunt

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

Start Hunting!

Translated by