---
title: "encode(commandBuffer:destinationMatrix:)"
framework: metalperformanceshaders
role: symbol
role_heading: Instance Method
path: "metalperformanceshaders/mpsmatrixrandom/encode(commandbuffer:destinationmatrix:)"
---

# encode(commandBuffer:destinationMatrix:)

## Declaration

```swift
func encode(commandBuffer: any MTLCommandBuffer, destinationMatrix: MPSMatrix)
```
