<!--
{
  "availability" : [
    "macOS: 10.0.0 - 10.14.0"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/vSgesub(_:_:_:_:_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "c:@F@vSgesub"
  },
  "title" : "vSgesub(_:_:_:_:_:_:_:)"
}
-->

# vSgesub(_:_:_:_:_:_:_:)

Subtracts two general matrices or their transposes.

```
func vSgesub(_ height: Int32, _ width: Int32, _ a: UnsafePointer<vFloat>, _ forma: CChar, _ b: UnsafePointer<vFloat>, _ formb: CChar, _ c: UnsafeMutablePointer<vFloat>)
```

## Parameters

`height`

number of rows in the matrices to be subtracted; must be a multiple of 4.

`width`

number of columns in the matrices to be subtracted; must be a multiple of 4.

`a`

a matrix with elements of type `float`.  If `forma` = ‘N’, the matrix itself is used in the calculation and it has `height` rows and `width` columns.  If `forma` = ‘T’, the transpose is used and `a` has `width` rows and `height` columns.

`forma`

selector with a value of ‘N’ or ‘T’.

`b`

a matrix with elements of type `float`.  If `formb` = ‘N’, the matrix itself is used in the calculation and it has `height` rows and `width` columns.  If `formb` = ‘T’, the transpose is used and `b` has `width` rows and `height` columns.

`formb`

selector with a value of  ‘N’ or ‘T’.

`c`

destination matrix with `height` rows and `width` columns.

## Discussion

Matrix `b` (or its transpose) is subtracted from matrix `a` (or its transpose); the result is stored in mactrix `c`.

---

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)