Quantcast

Documentation Center

  • Trial Software
  • Product Updates

convtemp

Convert from temperature units to desired temperature units

Syntax

convertedValues = convtemp(valuesToConvert, inputTemperatureUnits, outputTemperatureUnits)

Description

convertedValues = convtemp(valuesToConvert, inputTemperatureUnits, outputTemperatureUnits) computes the conversion factor from specified input temperature units to specified output temperature units. It then applies the conversion factor to the input, to produce the output in the desired units.

Input Arguments

valuesToConvert

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

inputTemperatureUnits

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

'K'Kelvin
'F'Degrees Fahrenheit
'C'Degrees Celsius
'R'Degrees Rankine

outputTemperatureUnits

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

'K'Kelvin
'F'Degrees Fahrenheit
'C'Degrees Celsius
'R'Degrees Rankine

Output Arguments

convertedValues

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

Examples

Convert three temperatures from degrees Celsius to degrees Fahrenheit:

a = convtemp([0 100 15],'C','F')

a =

   32.0000  212.0000   59.0000

See Also

| | | | | | | | |

Was this topic helpful?