Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub getNormalisasi()
- Dim row As Integer = matriksKeputusanTable.RowCount
- Dim column As Integer = matriksKeputusanTable.ColumnCount
- Dim data = New String(row, column) {}
- Dim temp = New Double(row) {}
- Dim value = New Double(column) {}
- Dim dt As New DataTable
- Dim dataSet As New DataSet
- matriksTernormalisasiTable.ColumnCount = column
- matriksTernormalisasiTable.RowCount = row
- For index = 0 To getKriteria.Length - 2
- matriksTernormalisasiTable.Columns(index).Name = getKriteria(index)
- Next
- matriksTernormalisasiTable.Refresh()
- Dim i As Integer = 0
- Dim j As Integer = 0
- While i < column
- j = 0
- While j < row
- temp(j) = CDbl(matriksKeputusanTable.Rows(j).Cells(i).Value.ToString)
- j += 1
- End While
- i += 1
- End While
- Dim pembagi
- For index1 = 0 To row - 1
- For index2 = 0 To column - 1
- 'inisialisai nilai pembagi per kolom
- pembagi = 0
- 'hitung nilai total pembagi per kolom
- For index3 = 0 To row - 1
- pembagi += matriksKeputusanTable.Rows(index3).Cells(index2).Value ^ 2
- Next
- data(index1, index2) = (matriksKeputusanTable.Rows(index1).Cells(index2).Value.ToString) / Math.Sqrt(pembagi)
- matriksTernormalisasiTable.Rows(index1).Cells(index2).Value = data(index1, index2)
- Next
- Next
- matriksTernormalisasiTable.Refresh()
- End Sub
Add Comment
Please, Sign In to add comment