<!--
{
  "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_matrix_cols(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "c:@F@la_matrix_cols"
  },
  "title" : "la_matrix_cols(_:)"
}
-->

# la_matrix_cols(_:)

```
func la_matrix_cols(_ matrix: la_object_t) -> la_count_t
```

## Discussion\abstract Get the number of columns in a matrix.
\discussion If the argument has an error status, zero is returned.
If the argument is a vector, the number of columns may be 1 or length(vector)
depending on the orientation of the vector.
If the argument is a matrix, the number of columns is returned.
Otherwise, zero is returned.

---

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)