Each registry key represents a row, with values for columns.
Set-ItemProperty -Path $path -Name "MatrixBinary" -Value ([byte[]]$bytes) -Type Binary $readBytes = (Get-ItemProperty -Path $path -Name "MatrixBinary").MatrixBinary $rowsRead = [BitConverter]::ToInt32($readBytes, 0) $colsRead = [BitConverter]::ToInt32($readBytes, 4) $matrix = @() for ($i = 0; $i -lt $rowsRead * $colsRead; $i++) $offset = 8 + $i * 4 $matrix += [BitConverter]::ToSingle($readBytes, $offset) matrix regedit
Example: 2×3 matrix of 32-bit floats (24 bytes data + 8 header = 32 bytes total). Each registry key represents a row, with values for columns
[rows:4 bytes][cols:4 bytes][data: rows×cols × element_size] Each registry key represents a row