This is machine translation

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

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

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 character vectors or 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. Supported units are:

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

outputAngleUnits

Specified output angle units. Supported units 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

Introduced in R2006b