<!--
{
  "availability" : [
    "iOS: 8.0.0 - 14.0.0",
    "iPadOS: 8.0.0 - 14.0.0",
    "macCatalyst: 13.1.0 - 14.0.0",
    "macOS: 10.10.0 - 11.0.0",
    "tvOS: 8.0.0 - 14.0.0",
    "visionOS: 1.0.0 - 1.0.0",
    "watchOS: 1.0.0 - 7.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/la_vector_from_matrix_row(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "c:@F@la_vector_from_matrix_row"
  },
  "title" : "la_vector_from_matrix_row(_:_:)"
}
-->

# la_vector_from_matrix_row(_:_:)

Creates a vector from the specified row of the matrix.

```
func la_vector_from_matrix_row(_ matrix: la_object_t, _ matrix_row: la_count_t) -> la_object_t
```

## Return Value

The resulting vector is a 1 x cols(matrix) vector.

## Discussion

### Parameters

- matrix: Matrix from which to create the row vector.
- matrix_row: The zero-based index of the row to create the vector from.

Creates a vector from the specified row of the matrix.  If the value for
matrix_row is less than zero or greater than rows(matrix)-1,
[`LA_INVALID_PARAMETER_ERROR`](/documentation/Accelerate/LA_INVALID_PARAMETER_ERROR) is returned.

If matrix is a splat, [`LA_INVALID_PARAMETER_ERROR`](/documentation/Accelerate/LA_INVALID_PARAMETER_ERROR) is returned.

Always returns a 1 x vector_length vector.

---

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)