Documentation

rad2deg

Convert angle from radians to degrees

Syntax

D = rad2deg(R)

Description

example

D= rad2deg(R)converts angle units from radians to degrees for each element ofR.

Examples

collapse all

Convertpiinto degrees.

D = rad2deg(pi)
D = 180

Specify the mean radius of Earth and the distance from Munich to Bangalore measured along the Earth's surface (in kilometers). Compute the spherical distance between Munich and Bangalore in degrees.

dist = 7194; radEarth = 6371; R = dist/radEarth; D = rad2deg(R)
D = 64.6972

Input Arguments

collapse all

Angle in radians, specified as a scalar, vector, matrix, or multidimensional array. IfRcontains complex elements,rad2degconverts the real and imaginary parts separately.

Data Types:single|double
Complex Number Support:Yes

Output Arguments

collapse all

Angles in degrees, returned as a scalar, vector, matrix, or multidimensional array.Dis the same size asR.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

See Also

Introduced in R2015b

Was this topic helpful?