File Exchange

image thumbnail

Complex numbers functions, Conversion of Radians to Degrees

version (3.41 KB) by Scott Williams
Convert polar to rectangular, rectangular to polar, radians to degrees, degrees to radians


Updated 20 Apr 2015

View License

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

Cite As

Scott Williams (2019). Complex numbers functions, Conversion of Radians to Degrees (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (2)

Hi, I've just noticed the question. Here's a late reply.. Functions on the file exchange can be used by unzipping and dragging them to your default Matlab folder. By selecting file/open in Matlab you should be able to identify the required installation path. Following this, functions installed will be accessible while using Matlab. Functions can be accessed by typing the commands in the workspace or using them in scripts.

Jay Mehta

how to install these files


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.

MATLAB Release Compatibility
Created with R2012a
Compatible with any release
Platform Compatibility
Windows macOS Linux