rad2deg - Convert angle from radians to degrees - MATLAB (original) (raw)

Main Content

Convert angle from radians to degrees

Syntax

Description

[D](#buwic64-D) = rad2deg([R](#buwic64-R)) converts angle units from radians to degrees for each element of R.

example

Examples

collapse all

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)

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

expand all

Therad2deg function fully supports tall arrays. For more information, see Tall Arrays.

The rad2deg function fully supports GPU arrays. To run the function on a GPU, specify the input data as a gpuArray (Parallel Computing Toolbox). For more information, see Run MATLAB Functions on a GPU (Parallel Computing Toolbox).

Version History

Introduced in R2015b