# convacc

Convert from acceleration units to specified acceleration units

## Syntax

``````convertedValues = convacc(valuesToConvert,inputAccelUnits,outputAccelUnits)``````

## Description

example

``````convertedValues = convacc(valuesToConvert,inputAccelUnits,outputAccelUnits)``` computes the conversion factor from specified input acceleration units to specified output acceleration units. The function then applies the conversion factor to the input to produce the output in the specified units. ```

## Examples

collapse all

Convert three accelerations from feet per second squared to meters per second squared.

`a = convacc([3 10 20],'ft/s^2','m/s^2')`
```a = 1×3 0.9144 3.0480 6.0960 ```

## Input Arguments

collapse all

Values to convert, specified as a floating-point array of size m-by-n values. All values must have the same unit conversions from `inputAccelUnits` to `outputAccelUnits`.

Data Types: `double`

Input acceleration units, specified as one of these values.

 `'ft/s^2'` Feet per second squared `'m/s^2'` Meters per second squared `'km/s^2'` Kilometers per second squared `'in/s^2'` Inches per second squared `'km/h-s'` Kilometers per hour per second `'mph/s'` Miles per hour per second `'G''s'` G-force (G's) acceleration

Data Types: `char` | `string`

Output acceleration units, specified as one of these values.

 `'ft/s^2'` Feet per second squared `'m/s^2'` Meters per second squared `'km/s^2'` Kilometers per second squared `'in/s^2'` Inches per second squared `'km/h-s'` Kilometers per hour per second `'mph/s'` Miles per hour per second `'G''s'` g-units

Data Types: `char` | `string`

## Output Arguments

collapse all

Converted values, returned as a floating-point array of size m-by-n.

## Version History

Introduced in R2006b