H I'm using VB.NET, and i have a two dimensional array. How do I extract a one-dimensional array from it? I.E the 3rd row.
Something like MAT[0] which i would do in java to get the first row from a matrix.
Thanks.
H I'm using VB.NET, and i have a two dimensional array. How do I extract a one-dimensional array from it? I.E the 3rd row.
Something like MAT[0] which i would do in java to get the first row from a matrix.
Thanks.
I think you have to write a simple function to get a single row as an array, for example:
Private Function GetRow(matrix As Byte(,), row_number As Integer) As Byte()
'get the number of columns of your matrix
Dim number_of_columns As Integer = matrix.GetLength(1)
'define empty array, at the end of the 'for' cycle it will contain requested row's values
Dim values As Byte() = Nothing
For i As Integer = 0 To number_of_columns - 1
'Resize array
ReDim Preserve values(i)
'Populate array element
values(i) = matrix(row_number, i)
Next
Return values
End Function