Documentation Center

  • Trial Software
  • Product Updates

convang

Convert from angle units to desired angle units

Syntax

convertedValues = convang(valuesToConvert, inputAngleUnits, outputAngleUnits)

Description

convertedValues = convang(valuesToConvert, inputAngleUnits, outputAngleUnits) computes the conversion factor from specified input angle units to specified output angle units. It then applies the conversion factor to the input to produce the output in the desired units. inputAngleUnits and outputAngleUnits are strings.

Input Arguments

valuesToConvert

Floating-point array of size m-by-n values the function is to convert. All values must have the same unit conversions from inputAngleUnits to outputAngleUnits.

inputAngleUnits

Specified input angle units, as strings. Supported unit strings are:

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

outputAngleUnits

Specified output angle units, as strings. Supported unit strings are:

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

Output Arguments

convertedValues

Floating-point array of size m-by-n values that the function has converted.

Examples

Convert three angles from degrees to radians:

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

a =

    0.0524    0.1745    0.3491

See Also

| | | | | | | | |

Was this topic helpful?