Main Content

convang

Convert from angle units to specified angle units

Description

convertedValues = convang(valuesToConvert,inputAngleUnits,outputAngleUnits) computes the conversion factor from specified input angle units to specified output angle units. The function then applies the conversion factor to the input to produce the output in the specified units.

example

Examples

collapse all

Convert three angles from degrees to radians.

a = convang([3 10 20],'deg','rad')
a = 1×3

    0.0524    0.1745    0.3491

Input Arguments

collapse all

Values to convert, specified as a floating-point array of size m-by-n. All values must have the same unit conversions from inputAngleUnits to outputAngleUnits.

Data Types: double

Input angle units, specified as one of these values.

'deg'Degrees
'rad'Radians
'rev'Revolutions

Data Types: string

Output angle units, specified as one of these values.

'deg'Degrees
'rad'Radians
'rev'Revolutions

Data Types: string

Output Arguments

collapse all

Converted values, returned as a floating-point array of size m-by-n.

Version History

Introduced in R2006b