<!--
{
  "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/ramp(in:count:)-79aw7",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "s:10Accelerate4vDSPO4ramp2in5countSaySfGSNySfG_SitFZ"
  },
  "title" : "ramp(in:count:)"
}
-->

# ramp(in:count:)

Returns a double-precision vector that contains monotonically incrementing or decrementing values within a range.

```
static func ramp(in range: ClosedRange<Float>, count: Int) -> [Float]
```

## Parameters

`range`

The start and end values of the generated ramp.

`count`

The number of elements in the ramp.

## Discussion

Use this function to generate and return a vector populated with ramped values.

The following code generates a ramped vector with values in the range `0 ... 7`:

```swift
    let ramp = vDSP.ramp(in: Float(0) ... 7,
                         count: 8)
    
    // Prints "[0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0]".
    print(ramp)
```

---

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)