Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
是否有与Python';是cmath.rect吗?_Python_Matlab_Complex Numbers_Cmath - Fatal编程技术网

是否有与Python';是cmath.rect吗?

是否有与Python';是cmath.rect吗?,python,matlab,complex-numbers,cmath,Python,Matlab,Complex Numbers,Cmath,是否有一个类似于Pythons的cmath.rect(r,phi)的Matlab,它返回带有极坐标r和phi的复数 x = r * complex( cos(phi), sin(phi) ); 我想你在找我。但参数的顺序不同,即,pol2cart(phi,r)如下所示: [x,y] = pol2cart(pi/6,1) x = 0.8660 y = 0.5000 如果需要复杂的输出,可以在以后执行以下操作: complex(x,y) ans = 0.8660

是否有一个类似于Pythons的
cmath.rect(r,phi)
的Matlab,它返回带有极坐标
r
phi
的复数

x = r * complex(  cos(phi), sin(phi)  );

我想你在找我。但参数的顺序不同,即,
pol2cart(phi,r)
如下所示:

[x,y] = pol2cart(pi/6,1)
x =
    0.8660
y =
    0.5000
如果需要复杂的输出,可以在以后执行以下操作:

complex(x,y)
ans =    
   0.8660 + 0.5000i