Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

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 of R.

Examples

collapse all

Convert pi into 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. If R contains complex elements, rad2deg converts 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. D is the same size as R.

Extended Capabilities

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

See Also

Introduced in R2015b

Was this topic helpful?