<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/vDSP/meanMagnitude(_:)-3fica",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "s:10Accelerate4vDSPO13meanMagnitudeySfxAA0A6BufferRzSf7ElementRtzlFZ"
  },
  "title" : "meanMagnitude(_:)"
}
-->

# meanMagnitude(_:)

Returns the mean of magnitudes of a single-precision vector.

```
static func meanMagnitude<U>(_ vector: U) -> Float where U : AccelerateBuffer, U.Element == Float
```

## Parameters

`vector`

The source vector.

## Discussion

This function calculates and returns the mean magnitude of a supplied vector.

The following is an example of using [`meanMagnitude(_:)`](/documentation/Accelerate/vDSP/meanMagnitude(_:)-3fica):

```swift
    let a: [Float] = [-8, -4, -2, 0, 2, 4, 8]

    let mean = vDSP.meanMagnitude(a)
    
    print(mean) // Prints "4.0".
```

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)