convlength - Convert from length units to desired length units

Syntax

a = convlength(v, ui, uo)

Description

a = convlength(v, ui, uo) computes the conversion factor from specified input length units, ui, to specified output length units, uo, and applies the conversion factor to the input, v, to produce the output, a, in the desired units. v and a are floating-point arrays of size m-by-n. All of the values in v must have the same unit conversions from ui to uo. ui and uo are strings.

Supported unit strings are:

'ft'Feet
'm'Meters
'km'Kilometers
'in'Inches
'mi'Miles
'naut mi'Nautical miles

Examples

Convert three lengths from feet to meters:

a = convlength([3 10 20],'ft','m')

a =

    0.9144    3.0480    6.0960

See Also

convacc, convang, convangacc, convangvel, convdensity, convforce, convmass, convpres, convtemp, convvel

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS