convmass

Convert from mass units to desired mass units

Syntax

convertedValues = convmass(valuesToConvert, inputMassUnits, outputMassUnits)

Description

convertedValues = convmass(valuesToConvert, inputMassUnits, outputMassUnits) computes the conversion factor from specified input mass units to specified output mass 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 inputMassUnits to outputMassUnits.

inputMassUnits

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

'lbm'Pound mass
'kg'Kilograms
'slugs'Slugs

outputMassUnits

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

'lbm'Pound mass
'kg'Kilograms
'slugs'Slugs

Output Arguments

convertedValues

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

Examples

Convert three masses from pound mass to kilograms:

a = convmass([3 1 5],'lbm','kg')

a =

    1.3608    0.4536    2.2680
Was this topic helpful?