rad2deg
Converts angles from radians to degrees.
Category: Mathematics > Elementary Math
Syntax
D = rad2deg(R)
Multiplies each element of R by 180/pi.
Description
A full turn is 2*pi radians or 360 degrees, so one radian is about 57.2958 degrees. The conversion is a plain multiplication, which means rounding errors can appear: the result for pi/6 is very near 30 but may differ from it in the last bits.
The opposite conversion is deg2rad. For trigonometry directly in degrees, sind, cosd and tand are more accurate than converting first.
Input arguments
R- Angles in radians, as a real floating-point array.
Output arguments
D- Angles in degrees, same size as
R.
Example
Common angles
rad2deg([0 pi/2 pi 2*pi])
round(rad2deg(pi/6))
Output
ans = 1×4
0 90 180 360
ans = 30
Notes
Integer-class input such as int8 is not accepted.