Complex numbers functions, Conversion of Radians to Degrees

版本 1.1.0.0 (3.4 KB) 作者: Scott Williams
Convert polar to rectangular, rectangular to polar, radians to degrees, degrees to radians
310.0 次下载
更新时间 2015/4/20

查看许可证

While these functions will never win an award (they are in some cases just a line or 2), I have found them very handy for calculations where matlab functions may require a few extra steps. These functions have served me well, in particular pol2rec and rec2pol.
rec2pol(complex number) converts a complex number eg. 1-i to magnitude, angle degrees form [0.7071 -45]
the opposite function:
pol2rec(magnitude, phase) converts a polar number eg. 1 angle -45 to a complex number..
pol2rec(0.7071,-45)=1-i (could use sqrt(2)/2) to be precise)
rad2deg(radians) converts radians to degrees.
deg2rad(degrees) converts degrees to radians.
Help file provides examples of these elementary functions

引用格式

Scott Williams (2024). Complex numbers functions, Conversion of Radians to Degrees (https://www.mathworks.com/matlabcentral/fileexchange/50550-complex-numbers-functions-conversion-of-radians-to-degrees), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2012a
兼容任何版本
平台兼容性
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.1.0.0

Changed rec2pol so answer is symbolic (displays 8 decimal places). I mistakenly thought that users may find it useful having output to rec2pol as a double.

1.0.0.0