Main Content

Length Conversion

Convert from length units to desired length units

  • Length Conversion block

Libraries:
Aerospace Blockset / Utilities / Unit Conversions

Description

The Length Conversion block computes the conversion factor from specified input length units to specified output length units and applies the conversion factor to the input signal.

The Length Conversion block port labels change based on the input and output units selected from the Initial unit and the Final unit lists.

Ports

Input

expand all

Length, specified as a scalar or array, in initial length units.

Dependencies

The input port label depends on the Initial unit setting.

Data Types: double

Output

expand all

Length, returned as a scalar or array, in final length units.

Dependencies

The output port label depends on the Final unit setting.

Data Types: double

Parameters

expand all

Input units, specified as:

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

Dependencies

The input port label depends on the Initial unit setting.

Programmatic Use

Block Parameter: IU
Type: character vector
Values: 'm' | 'ft' | 'km' | 'in' | 'mi' | 'naut mi'
Default: 'ft'

Output units, specified as:

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

Dependencies

The output port label depends on the Final unit setting.

Programmatic Use

Block Parameter: OU
Type: character vector
Values: 'm' | 'ft' | 'km' | 'in' | 'mi' | 'naut mi'
Default: 'm'

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Version History

Introduced before R2006a