Main Content

convmass

Convert from mass units to specified mass units

Description

example

convertedValues = convmass(valuesToConvert,inputMassUnits,outputMassUnits) computes the conversion factor from specified input mass units to specified output mass units. The function then applies the conversion factor to the input to produce the output in the specified units.

Examples

collapse all

Convert three masses from pound mass to kilograms.

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

    1.3608    0.4536    2.2680

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 inputMassUnits to outputMassUnits.

Data Types: double

Input mass units, specified as one of these.

'lbm'Pound mass
'kg'Kilograms
'slug'Slugs

Data Types: string

Output mass units, specified as one of these.

'lbm'Pound mass
'kg'Kilograms
'slug'Slugs

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