---
title: "encode(to:sourceMatrices:resultMatrix:scale:offsetVector:biasVector:start:)"
framework: metalperformanceshaders
role: symbol
role_heading: Instance Method
path: "metalperformanceshaders/mpsmatrixsum/encode(to:sourcematrices:resultmatrix:scale:offsetvector:biasvector:start:)"
---

# encode(to:sourceMatrices:resultMatrix:scale:offsetVector:biasVector:start:)

## Declaration

```swift
func encode(to buffer: any MTLCommandBuffer, sourceMatrices: [MPSMatrix], resultMatrix: MPSMatrix, scale scaleVector: MPSVector?, offsetVector: MPSVector?, biasVector: MPSVector?, start startIndex: Int)
```
